aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix/guts/fopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/guts/fopen.c')
-rw-r--r--ports/unix/guts/fopen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ports/unix/guts/fopen.c b/ports/unix/guts/fopen.c
index 9dd6c33..c7b8da5 100644
--- a/ports/unix/guts/fopen.c
+++ b/ports/unix/guts/fopen.c
@@ -1,14 +1,14 @@
/*
- * Copyright (c) 2008-2010 Wind River Systems; see
+ * Copyright (c) 2008-2010, 2012 Wind River Systems; see
* guts/COPYRIGHT for information.
*
* static FILE *
* wrap_fopen(const char *path, const char *mode) {
* FILE * rc = 0;
*/
- struct stat buf;
+ PSEUDO_STATBUF buf;
int save_errno;
- int existed = (real_stat(path, &buf) != -1);
+ int existed = (base_stat(path, &buf) != -1);
rc = real_fopen(path, mode);
save_errno = errno;
@@ -17,15 +17,15 @@
int fd = fileno(rc);
pseudo_debug(2, "fopen '%s': fd %d <FILE %p>\n", path, fd, (void *) rc);
- if (real_fstat(fd, &buf) != -1) {
+ if (base_fstat(fd, &buf) != -1) {
if (!existed) {
- pseudo_client_op_plain(OP_CREAT, 0, -1, -1, path, &buf);
+ pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf);
}
- pseudo_client_op_plain(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf);
+ pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf);
} else {
pseudo_debug(1, "fopen (fd %d) succeeded, but fstat failed (%s).\n",
fd, strerror(errno));
- pseudo_client_op_plain(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, 0);
+ pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, 0);
}
errno = save_errno;
}