summaryrefslogtreecommitdiff
path: root/os/windows/posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/windows/posix.c')
-rwxr-xr-xos/windows/posix.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/os/windows/posix.c b/os/windows/posix.c
index ea3736d5..ba7abb54 100755
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -124,8 +124,17 @@ void syslog(int priority, const char *message, ... /* argument */)
int sigaction(int sig, const struct sigaction *act,
struct sigaction *oact)
{
- errno = ENOSYS;
- return (-1);
+ int rc = 0;
+ void (*prev_handler)(int);
+
+ prev_handler = signal(sig, act->sa_handler);
+ if (oact != NULL)
+ oact->sa_handler = prev_handler;
+
+ if (prev_handler == SIG_ERR)
+ rc = -1;
+
+ return rc;
}
int lstat(const char * path, struct stat * buf)