diff options
Diffstat (limited to 'guts/fopen64.c')
-rw-r--r-- | guts/fopen64.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/guts/fopen64.c b/guts/fopen64.c index 0b0ab58..c6de09c 100644 --- a/guts/fopen64.c +++ b/guts/fopen64.c @@ -5,6 +5,7 @@ */ struct stat64 buf; int save_errno; + int existed = (real___xstat64(_STAT_VER, path, &buf) != -1); rc = real_fopen64(path, mode); @@ -16,13 +17,13 @@ pseudo_debug(2, "fopen64 '%s': fd %d\n", path, fd); if (real___fxstat64(_STAT_VER, fd, &buf) != -1) { if (!existed) { - pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); + pseudo_client_op(OP_CREAT, -1, -1, path, &buf); } - pseudo_client_op(OP_OPEN, 0, fd, -1, path, &buf); + pseudo_client_op(OP_OPEN, fd, -1, path, &buf); } else { pseudo_debug(1, "fopen64 (fd %d) succeeded, but fstat failed (%s).\n", fd, strerror(errno)); - pseudo_client_op(OP_OPEN, 0, fd, -1, path, 0); + pseudo_client_op(OP_OPEN, fd, -1, path, 0); } errno = save_errno; } |