diff options
Diffstat (limited to 'arch/um/kernel/exitcode.c')
-rw-r--r-- | arch/um/kernel/exitcode.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c index d21ebad666b4..8b7f2cdedf94 100644 --- a/arch/um/kernel/exitcode.c +++ b/arch/um/kernel/exitcode.c | |||
@@ -16,9 +16,13 @@ int uml_exitcode = 0; | |||
16 | static int read_proc_exitcode(char *page, char **start, off_t off, | 16 | static int read_proc_exitcode(char *page, char **start, off_t off, |
17 | int count, int *eof, void *data) | 17 | int count, int *eof, void *data) |
18 | { | 18 | { |
19 | int len; | 19 | int len, val; |
20 | 20 | ||
21 | len = sprintf(page, "%d\n", uml_exitcode); | 21 | /* Save uml_exitcode in a local so that we don't need to guarantee |
22 | * that sprintf accesses it atomically. | ||
23 | */ | ||
24 | val = uml_exitcode; | ||
25 | len = sprintf(page, "%d\n", val); | ||
22 | len -= off; | 26 | len -= off; |
23 | if(len <= off+count) *eof = 1; | 27 | if(len <= off+count) *eof = 1; |
24 | *start = page + off; | 28 | *start = page + off; |