Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorEgor Duda <deo@logos-m.ru>2001-02-16 21:49:20 +0300
committerEgor Duda <deo@logos-m.ru>2001-02-16 21:49:20 +0300
commitfc68bf34bb2352ce876e5e1173f518d8bdd1573a (patch)
treef1765af0a32dd49df55e8f882af12065d3158173 /winsup
parent00aae5a7403708895cbfcc34bc115838f73cf11f (diff)
* signal.cc (signal): Prohibit setting handlers for SIGKILL and SIGSTOP
* signal.cc (sigaction): Ditto * syscalls.cc (_lseek): Return EINVAL on invalid input
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/signal.cc4
-rw-r--r--winsup/cygwin/syscalls.cc7
3 files changed, 15 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 05a9c5c91..c035a64a7 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2001-02-16 Egor Duda <deo@logos-m.ru>
+
+ * signal.cc (signal): Prohibit setting handlers for SIGKILL and
+ SIGSTOP
+ * signal.cc (sigaction): Ditto
+ * syscalls.cc (_lseek): Return EINVAL on invalid input
+
Wed Feb 14 14:54:40 2001 Christophe Iasci <chrisiasci@aol.com>
* dlfcn.cc (dlopen): Do not call LoadLibrary with a NULL pointer, when
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index 61535fff3..ea4a4394a 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -46,7 +46,7 @@ signal (int sig, _sig_func_ptr func)
_sig_func_ptr prev;
/* check that sig is in right range */
- if (sig < 0 || sig >= NSIG)
+ if (sig < 0 || sig >= NSIG || sig == SIGKILL || sig == SIGSTOP)
{
set_errno (EINVAL);
syscall_printf ("SIG_ERR = signal (%d, %p)", sig, func);
@@ -260,7 +260,7 @@ sigaction (int sig, const struct sigaction *newact, struct sigaction *oldact)
if (newact)
{
- if ((sig == SIGKILL || sig == SIGSTOP) && newact->sa_handler != SIG_DFL)
+ if (sig == SIGKILL || sig == SIGSTOP)
{
set_errno (EINVAL);
return -1;
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 99e3de7ec..d5bb510ee 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -447,7 +447,12 @@ _lseek (int fd, off_t pos, int dir)
off_t res;
sigframe thisframe (mainthread);
- if (fdtab.not_open (fd))
+ if ( dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END )
+ {
+ set_errno ( EINVAL );
+ res = -1;
+ }
+ else if (fdtab.not_open (fd))
{
set_errno (EBADF);
res = -1;