From 9f612ccee5035371e4d7113fd15ffc4746c56830 Mon Sep 17 00:00:00 2001 From: jjohnstn Date: Mon, 7 May 2007 22:22:05 +0000 Subject: [PATCH] 2007-05-07 Patrick Mansfield * spu/open.c: Unconditionally set the "mode" to fix a bug where mode was not properly set. --- libgloss/ChangeLog | 9 +++++++-- libgloss/spu/open.c | 18 ++++-------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index e796c1b3f4..8f05be8d08 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,8 @@ +2007-05-07 Patrick Mansfield + + * spu/open.c: Unconditionally set the "mode" to fix a bug where + mode was not properly set. + 2007-05-03 Kazu Hirata * m68k/fido-_exit.c (_exit): Use stop #0x700. @@ -7,7 +12,7 @@ * m68k/fido.sc: Catch .text.*, .rodata.*, .data.*, .bss.*, .ctor.*, and .dtor.*. Wrap ctor/dtor-related sections with KEEP. -2007-04-04 Patrick Mansfield +2007-04-04 Patrick Mansfield * spu/syscalls.c: Rename _send_to_ppe __send_to_ppe, and set errno on return from the offload call. @@ -31,7 +36,7 @@ * spu/sbrk.c (sbrk): Adjust the stack pointer vector correctly so that GCC runtime stack checking works. Handle the backchain, too. -2007-02-21 Patrick Mansfield +2007-02-21 Patrick Mansfield * spu/gettimeofday.c: New file which adds SPU gettimeofday. * spu/jsre.h: Remove time, add gettimeofday. diff --git a/libgloss/spu/open.c b/libgloss/spu/open.c index c005f1d0ac..c6882bd860 100644 --- a/libgloss/spu/open.c +++ b/libgloss/spu/open.c @@ -39,6 +39,7 @@ open (const char *filename, int flags, ...) { syscall_open_t sys ; syscall_out_t *psys_out = ( syscall_out_t* )&sys; + va_list ap; sys.pathname = ( unsigned int )filename; @@ -63,22 +64,11 @@ open (const char *filename, int flags, ...) sys.flags |= ( ( flags & O_WRONLY ) ? JSRE_O_WRONLY : 0 ); sys.flags |= ( ( flags & O_RDWR ) ? JSRE_O_RDWR : 0 ); - /* FIXME: we have to check/map all flags */ - if ((sys.flags & O_CREAT)) - { - va_list ap; - - va_start (ap, flags); - sys.mode = va_arg (ap, int); - va_end (ap); - - } - else - { - sys.mode = 0; - } + va_start (ap, flags); + sys.mode = va_arg (ap, int); + va_end (ap); __send_to_ppe (JSRE_POSIX1_SIGNALCODE, JSRE_OPEN, &sys); -- 2.11.0