X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ipc%2Fshm.c;h=790240cd067f60860957951db601dfb2fc81e373;hb=ad2a3f13b7258a5daaaeb8cff9f835aac468b71d;hp=d05f6b564998773bdc401c27aa9425e19ac6a7ee;hpb=19f2b8dfea10e4d5cd34feb08cbab738504c25cf;p=linux-2.6 diff --git a/ipc/shm.c b/ipc/shm.c index d05f6b5649..790240cd06 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -1058,16 +1058,16 @@ asmlinkage long sys_shmdt(char __user *shmaddr) static int sysvipc_shm_proc_show(struct seq_file *s, void *it) { struct shmid_kernel *shp = it; - char *format; -#define SMALL_STRING "%10d %10d %4o %10u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n" -#define BIG_STRING "%10d %10d %4o %21u %5u %5u %5d %5u %5u %5u %5u %10lu %10lu %10lu\n" +#if BITS_PER_LONG <= 32 +#define SIZE_SPEC "%10lu" +#else +#define SIZE_SPEC "%21lu" +#endif - if (sizeof(size_t) <= sizeof(int)) - format = SMALL_STRING; - else - format = BIG_STRING; - return seq_printf(s, format, + return seq_printf(s, + "%10d %10d %4o " SIZE_SPEC " %5u %5u " + "%5lu %5u %5u %5u %5u %10lu %10lu %10lu\n", shp->shm_perm.key, shp->shm_perm.id, shp->shm_perm.mode,