BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000107 [BusyBox] Other minor always 02-16-05 01:01 04-16-05 00:51
Reporter vsauder View Status public  
Assigned To BusyBox
Priority normal Resolution open  
Status closed   Product Version 1.00
Summary 0000107: cat does not exit with failure status if write fails
Description If the cat command fails to write, it still returns a SUCCESS.

"cat hair > /dev/full" will not exit with an error.
Additional Information Examples:
$ cat noodles > /dev/full || echo FAILED # never echos FAILED

or

$ while cat noodles ; do eval ; done > /dev/mtd/1
# fills up the device and then just starts spewing errors but never ends the loop.

I fixed this for the short term with the following patch. I have not explored all the ramifications of what else could be affected. I don't have time for that now but I thought I could at least do this much.

Thanx for the great product.
Attached Files  copy-file-write-err.patch [^] (456 bytes) 02-16-05 01:01
 copyfd-maybe-ret-neg.patch [^] (1,538 bytes) 04-15-05 23:21

- Relationships

- Notes
(0000157)
vapier
04-15-05 23:03

glancing at the logic in copyfd.c, it looks like bb_full_fd_action() never returns -1 ...

the other portions of busybox that actually check the return status of these copy functions are:
cat
ftpgetput
tar
copy_file
print_file
 
(0000158)
vapier
04-15-05 23:22

try this new patch ... it worked for me and seems to be better in that it will only return -1 if (1) nothing has yet been read and (2) an error was encountered
 
(0000159)
vapier
04-16-05 00:51

sratch that, erik has reworked copyfd.c and it works now for the few test cases we have here :)
 

- Issue History
Date Modified Username Field Change
02-16-05 01:01 vsauder New Issue
02-16-05 01:01 vsauder File Added: copy-file-write-err.patch
03-16-05 12:27 andersen Assigned To andersen => BusyBox
04-15-05 23:03 vapier Note Added: 0000157
04-15-05 23:21 vapier File Added: copyfd-maybe-ret-neg.patch
04-15-05 23:22 vapier Note Added: 0000158
04-16-05 00:51 vapier Status assigned => closed
04-16-05 00:51 vapier Note Added: 0000159


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker