summaryrefslogtreecommitdiff
path: root/src/stdio/remove.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-30 18:35:35 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-30 18:35:35 -0500
commitd5e1fa835e46dac2e1729e73c5e6743ef78714c7 (patch)
tree656a1c893b9930f444761c2811b1fc57fccd6802 /src/stdio/remove.c
parent7cdd27f8dce39bed37a266fa578cfaedce0a015d (diff)
fix to compile under c89
Diffstat (limited to 'src/stdio/remove.c')
-rw-r--r--src/stdio/remove.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/stdio/remove.c b/src/stdio/remove.c
index 2ac91743..8b6c5925 100644
--- a/src/stdio/remove.c
+++ b/src/stdio/remove.c
@@ -1,13 +1,16 @@
-#if 0
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE
#define POSIX_FORCED
#endif
#include <stdio.h>
+#include "_stdio.h"
+
+#if 0
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#endif
#ifdef POSIX_FORCED
#include "_syscall.h"
@@ -20,15 +23,20 @@
int remove(const char *filename)
{
- struct stat st;
+ /* struct stat st; */
SIGNAL_SAFE(0);
+ /*
stat(filename, &st);
if (S_ISDIR(st.st_mode)) {
return rmdir(filename);
}
return unlink(filename);
+ */
+
+ (void)filename;
+ return -1;
}
/***
@@ -40,5 +48,3 @@ open that file will fail unless creating a new file.
IMPLEMENTATION(Whether the file is removed if it is open)
STDC(1)
*/
-
-#endif