fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / um / kernel / exitcode.c
index d21ebad..8b7f2cd 100644 (file)
@@ -16,9 +16,13 @@ int uml_exitcode = 0;
 static int read_proc_exitcode(char *page, char **start, off_t off,
                              int count, int *eof, void *data)
 {
-       int len;
+       int len, val;
 
-       len = sprintf(page, "%d\n", uml_exitcode);
+       /* Save uml_exitcode in a local so that we don't need to guarantee
+        * that sprintf accesses it atomically.
+        */
+       val = uml_exitcode;
+       len = sprintf(page, "%d\n", val);
        len -= off;
        if(len <= off+count) *eof = 1;
        *start = page + off;