Revision c07ecc68

b/linux-user/syscall.c
101 101
#include <linux/fb.h>
102 102
#include <linux/vt.h>
103 103
#include <linux/dm-ioctl.h>
104
#include <linux/reboot.h>
104 105
#include "linux_loop.h"
105 106
#include "cpu-uname.h"
106 107

  
......
6451 6452
        break;
6452 6453
#endif
6453 6454
    case TARGET_NR_reboot:
6454
        if (!(p = lock_user_string(arg4)))
6455
            goto efault;
6456
        ret = reboot(arg1, arg2, arg3, p);
6457
        unlock_user(p, arg4, 0);
6455
        if (arg3 == LINUX_REBOOT_CMD_RESTART2) {
6456
           /* arg4 must be ignored in all other cases */
6457
           p = lock_user_string(arg4);
6458
           if (!p) {
6459
              goto efault;
6460
           }
6461
           ret = get_errno(reboot(arg1, arg2, arg3, p));
6462
           unlock_user(p, arg4, 0);
6463
        } else {
6464
           ret = get_errno(reboot(arg1, arg2, arg3, NULL));
6465
        }
6458 6466
        break;
6459 6467
#ifdef TARGET_NR_readdir
6460 6468
    case TARGET_NR_readdir:

Also available in: Unified diff