aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-08-31 12:42:06 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-08-31 12:42:06 +0200
commit8d3e225a2d1d980bcedb825f294b6a8041fe3f1b (patch)
treebfd632b8dbc3bb25c23aa437ebd0d2ea37818fe9 /shell
parent4e7dd3c363377aefd6ac60ab4335e773482bcca1 (diff)
downloadbusybox-w32-8d3e225a2d1d980bcedb825f294b6a8041fe3f1b.tar.gz
busybox-w32-8d3e225a2d1d980bcedb825f294b6a8041fe3f1b.tar.bz2
busybox-w32-8d3e225a2d1d980bcedb825f294b6a8041fe3f1b.zip
libbb: add xfstat function
function old new delta xfstat - 25 +25 mkfs_ext2_main 2421 2423 +2 mkfs_reiser_main 1197 1194 -3 next 312 307 -5 ar_main 533 522 -11 mkfs_minix_main 2938 2924 -14 mkfs_vfat_main 1511 1495 -16 writeTarFile 272 255 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 27/-66) Total: -39 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 921367be5..28a8bb60c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4989,9 +4989,13 @@ noclobberopen(const char *fname)
4989 * revealed that it was a regular file, and the file has not been 4989 * revealed that it was a regular file, and the file has not been
4990 * replaced, return the file descriptor. 4990 * replaced, return the file descriptor.
4991 */ 4991 */
4992 if (fstat(fd, &finfo2) == 0 && !S_ISREG(finfo2.st_mode) 4992 if (fstat(fd, &finfo2) == 0
4993 && finfo.st_dev == finfo2.st_dev && finfo.st_ino == finfo2.st_ino) 4993 && !S_ISREG(finfo2.st_mode)
4994 && finfo.st_dev == finfo2.st_dev
4995 && finfo.st_ino == finfo2.st_ino
4996 ) {
4994 return fd; 4997 return fd;
4998 }
4995 4999
4996 /* The file has been replaced. badness. */ 5000 /* The file has been replaced. badness. */
4997 close(fd); 5001 close(fd);