[Date Prev][Date Next] [Chronological] [Thread] [Top]

Patch: sig_atomic_t can be unsigned (ITS#1736)



Full_Name: Hallvard B. Furuseth
Version: HEAD (2002-04-08)
OS: 
URL: http://folk.uio.no/hbf/OpenLDAP/sig_atomic_t.txt
Submission from: (NULL) (158.36.148.34)


slapd/daemon.c assigns (and tests) -1 to `sig_atomic_t slapd_shutdown',
even though ANSI C §4.7 allows sig_atomic_t to be unsigned.
Here is a patch.  It replaces the value `sig' with 1 and -1 with 2.
I also simplified the code
                } else if ( slapd_shutdown < 0 ) {
        #ifdef HAVE_NT_SERVICE_MANAGER
                        if (slapd_shutdown == -1)
                        ...
since the only value < 0 which could occur was -1.  (That is,
provided the signal number 'sig' is not negative:-)