diff options
Diffstat (limited to 'fs/compat.c')
| -rw-r--r-- | fs/compat.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/fs/compat.c b/fs/compat.c index 7e7e5bc4f3cf..ce982f6e8c80 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
| @@ -55,6 +55,20 @@ | |||
| 55 | 55 | ||
| 56 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | 56 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); |
| 57 | 57 | ||
| 58 | int compat_log = 1; | ||
| 59 | |||
| 60 | int compat_printk(const char *fmt, ...) | ||
| 61 | { | ||
| 62 | va_list ap; | ||
| 63 | int ret; | ||
| 64 | if (!compat_log) | ||
| 65 | return 0; | ||
| 66 | va_start(ap, fmt); | ||
| 67 | ret = vprintk(fmt, ap); | ||
| 68 | va_end(ap); | ||
| 69 | return ret; | ||
| 70 | } | ||
| 71 | |||
| 58 | /* | 72 | /* |
| 59 | * Not all architectures have sys_utime, so implement this in terms | 73 | * Not all architectures have sys_utime, so implement this in terms |
| 60 | * of sys_utimes. | 74 | * of sys_utimes. |
| @@ -359,7 +373,7 @@ static void compat_ioctl_error(struct file *filp, unsigned int fd, | |||
| 359 | sprintf(buf,"'%c'", (cmd>>24) & 0x3f); | 373 | sprintf(buf,"'%c'", (cmd>>24) & 0x3f); |
| 360 | if (!isprint(buf[1])) | 374 | if (!isprint(buf[1])) |
| 361 | sprintf(buf, "%02x", buf[1]); | 375 | sprintf(buf, "%02x", buf[1]); |
| 362 | printk("ioctl32(%s:%d): Unknown cmd fd(%d) " | 376 | compat_printk("ioctl32(%s:%d): Unknown cmd fd(%d) " |
| 363 | "cmd(%08x){%s} arg(%08x) on %s\n", | 377 | "cmd(%08x){%s} arg(%08x) on %s\n", |
| 364 | current->comm, current->pid, | 378 | current->comm, current->pid, |
| 365 | (int)fd, (unsigned int)cmd, buf, | 379 | (int)fd, (unsigned int)cmd, buf, |
| @@ -1841,7 +1855,7 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, | |||
| 1841 | 1855 | ||
| 1842 | } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec)); | 1856 | } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec)); |
| 1843 | 1857 | ||
| 1844 | if (tsp && !(current->personality & STICKY_TIMEOUTS)) { | 1858 | if (ret == 0 && tsp && !(current->personality & STICKY_TIMEOUTS)) { |
| 1845 | struct compat_timespec rts; | 1859 | struct compat_timespec rts; |
| 1846 | 1860 | ||
| 1847 | rts.tv_sec = timeout / HZ; | 1861 | rts.tv_sec = timeout / HZ; |
| @@ -1852,7 +1866,8 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp, | |||
| 1852 | } | 1866 | } |
| 1853 | if (compat_timespec_compare(&rts, &ts) >= 0) | 1867 | if (compat_timespec_compare(&rts, &ts) >= 0) |
| 1854 | rts = ts; | 1868 | rts = ts; |
| 1855 | copy_to_user(tsp, &rts, sizeof(rts)); | 1869 | if (copy_to_user(tsp, &rts, sizeof(rts))) |
| 1870 | ret = -EFAULT; | ||
| 1856 | } | 1871 | } |
| 1857 | 1872 | ||
| 1858 | if (ret == -ERESTARTNOHAND) { | 1873 | if (ret == -ERESTARTNOHAND) { |
