From 8ac0306085821bc4cee620b54f0c1e2c4ab007bf Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 3 Mar 2015 17:09:30 +0000 Subject: [PATCH] * msg.cc: Throughout, drop raising SIGSYS if cygserver is not running. * sem.cc: Ditto. * shm.cc: Ditto. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/msg.cc | 10 +--------- winsup/cygwin/release/1.7.35 | 3 +++ winsup/cygwin/sem.cc | 8 +------- winsup/cygwin/shm.cc | 12 ++---------- 5 files changed, 13 insertions(+), 26 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d3e12470c..bc2e14de1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2015-03-03 Corinna Vinschen + + * msg.cc: Throughout, drop raising SIGSYS if cygserver is not running. + * sem.cc: Ditto. + * shm.cc: Ditto. + 2015-03-03 Corinna Vinschen * common.din (issetugid): Export. diff --git a/winsup/cygwin/msg.cc b/winsup/cygwin/msg.cc index 5505dc453..3658b09ca 100644 --- a/winsup/cygwin/msg.cc +++ b/winsup/cygwin/msg.cc @@ -1,6 +1,6 @@ /* msg.cc: XSI IPC interface for Cygwin. - Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2014 Red Hat, Inc. + Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -116,8 +116,6 @@ msgctl (int msqid, int cmd, struct msqid_ds *buf) { syscall_printf ("-1 [%d] = msgctl ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); __leave; } return request.retval (); @@ -136,8 +134,6 @@ msgget (key_t key, int msgflg) { syscall_printf ("-1 [%d] = msgget ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); return -1; } return request.retval (); @@ -156,8 +152,6 @@ msgrcv (int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg) { syscall_printf ("-1 [%d] = msgrcv ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); __leave; } return request.rcvval (); @@ -179,8 +173,6 @@ msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) { syscall_printf ("-1 [%d] = msgsnd ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); __leave; } return request.retval (); diff --git a/winsup/cygwin/release/1.7.35 b/winsup/cygwin/release/1.7.35 index 51619f273..6773f758e 100644 --- a/winsup/cygwin/release/1.7.35 +++ b/winsup/cygwin/release/1.7.35 @@ -33,6 +33,9 @@ What changed: - Change getfacl long options from --all to --access and from --dir to --default, along the lines of the Linux getfacl tool. +- Don't raise a SIGSYS signal in the XSI IPC functions if cygserver is not + running. Just return -1 with errno set to ENOSYS. + Bug Fixes --------- diff --git a/winsup/cygwin/sem.cc b/winsup/cygwin/sem.cc index f7a5db674..2aa6b0c7c 100644 --- a/winsup/cygwin/sem.cc +++ b/winsup/cygwin/sem.cc @@ -1,6 +1,6 @@ /* sem.cc: XSI IPC interface for Cygwin. - Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2012, 2014 Red Hat, Inc. + Copyright 2002, 2003, 2004, 2005, 2008, 2009, 2012, 2014, 2015 Red Hat, Inc. This file is part of Cygwin. @@ -92,8 +92,6 @@ semctl (int semid, int semnum, int cmd, ...) { syscall_printf ("-1 [%d] = semctl ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); __leave; } return request.retval (); @@ -113,8 +111,6 @@ semget (key_t key, int nsems, int semflg) { syscall_printf ("-1 [%d] = semget ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); return -1; } return request.retval (); @@ -132,8 +128,6 @@ semop (int semid, struct sembuf *sops, size_t nsops) { syscall_printf ("-1 [%d] = semop ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); __leave; } return request.retval (); diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc index 868545e3b..c5ab708a4 100644 --- a/winsup/cygwin/shm.cc +++ b/winsup/cygwin/shm.cc @@ -1,7 +1,7 @@ /* shm.cc: XSI IPC interface for Cygwin. - Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012, 2013, 2014 - Red Hat, Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012, 2013, 2014, + 2015 Red Hat, Inc. This file is part of Cygwin. @@ -242,8 +242,6 @@ shmat (int shmid, const void *shmaddr, int shmflg) delete sph_entry; set_errno (request.error_code ()); --ssh_entry->ref_count; - if (request.error_code () == ENOSYS) - raise (SIGSYS); return (void *) -1; } sph_entry->ptr = ptr; @@ -267,8 +265,6 @@ shmctl (int shmid, int cmd, struct shmid_ds *buf) { syscall_printf ("-1 [%d] = shmctl ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); __leave; } if (cmd == IPC_RMID) @@ -310,8 +306,6 @@ shmdt (const void *shmaddr) { syscall_printf ("-1 [%d] = shmdt ()", request.error_code ()); set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); return -1; } shm_attached_list *sph_entry, *sph_next_entry; @@ -359,8 +353,6 @@ shmget (key_t key, size_t size, int shmflg) syscall_printf ("-1 [%d] = shmget ()", request.error_code ()); delete ssh_new_entry; set_errno (request.error_code ()); - if (request.error_code () == ENOSYS) - raise (SIGSYS); return -1; } int shmid = request.retval (); /* Shared mem ID */