diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-09-19 00:38:12 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-09-19 01:12:19 -0400 |
commit | 7af1443a9d319132087e1e9a3984b94c6998835c (patch) | |
tree | a38fbc03da6201e89a9e850115433df724eba7a4 /arch/powerpc/platforms/cell/spu_syscalls.c | |
parent | e55014923e65e4ee8e477a1212381cca0125f3aa (diff) |
[POWERPC] spufs: Handle errors in SPU coredump code, and support coredump to a pipe
Rework spufs_coredump_extra_notes_write() to check for and return errors.
If we're coredumping to a pipe we can't trust file->f_pos, we need to
maintain the foffset value passed to us. The cleanest way to do this is
to have the low level write routine increment foffset when we've
successfully written.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spu_syscalls.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_syscalls.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c index b0117a7c610..a9438b719fe 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c | |||
@@ -132,19 +132,17 @@ int elf_coredump_extra_notes_size(void) | |||
132 | int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset) | 132 | int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset) |
133 | { | 133 | { |
134 | struct spufs_calls *calls; | 134 | struct spufs_calls *calls; |
135 | int ret; | ||
135 | 136 | ||
136 | calls = spufs_calls_get(); | 137 | calls = spufs_calls_get(); |
137 | if (!calls) | 138 | if (!calls) |
138 | return 0; | 139 | return 0; |
139 | 140 | ||
140 | calls->coredump_extra_notes_write(file); | 141 | ret = calls->coredump_extra_notes_write(file, foffset); |
141 | 142 | ||
142 | spufs_calls_put(calls); | 143 | spufs_calls_put(calls); |
143 | 144 | ||
144 | /* Fudge foffset for now */ | 145 | return ret; |
145 | *foffset = file->f_pos; | ||
146 | |||
147 | return 0; | ||
148 | } | 146 | } |
149 | 147 | ||
150 | int register_spu_syscalls(struct spufs_calls *calls) | 148 | int register_spu_syscalls(struct spufs_calls *calls) |