compile warngin fixes merged from 2.2
authorGerald Carter <jerry@samba.org>
Mon, 17 Jun 2002 15:33:13 +0000 (15:33 +0000)
committerGerald Carter <jerry@samba.org>
Mon, 17 Jun 2002 15:33:13 +0000 (15:33 +0000)
(This used to be commit 29874f4b8fecdc7cbd84d656dafce54cca49e0b1)

source3/include/includes.h
source3/lib/messages.c
source3/nmbd/nmbd.c
source3/passdb/pdb_nisplus.c
source3/smbd/notify_kernel.c
source3/smbd/oplock_linux.c
source3/smbd/process.c
source3/smbd/server.c

index 705cb485fded8869701e6ba96d2ab435222cf59f..26931ffd97de42974e736b947aa17d08a688be37 100644 (file)
 /*
  * Define additional missing types
  */
-#ifndef HAVE_SIG_ATOMIC_T_TYPE
-typedef int sig_atomic_t;
+#if defined(HAVE_SIG_ATOMIC_T_TYPE) && defined(AIX)
+typedef sig_atomic_t SIG_ATOMIC_T;
+#elif defined(HAVE_SIG_ATOMIC_T_TYPE) && !defined(AIX)
+typedef sig_atomic_t VOLATILE SIG_ATOMIC_T;
+#else
+typedef int VOLATILE SIG_ATOMIC_T;
 #endif
 
 #ifndef HAVE_SOCKLEN_T_TYPE
index 480b6daf02a421d8df091de6bd8c31caacd0d21a..b5e89a6aaae3574c962034a9ea8ed9eb6927c101 100644 (file)
@@ -453,7 +453,7 @@ BOOL message_send_all(TDB_CONTEXT *conn_tdb, int msg_type,
        return True;
 }
 
-static VOLATILE sig_atomic_t gotalarm;
+static SIG_ATOMIC_T gotalarm;
 
 /***************************************************************
  Signal function to tell us we timed out.
index 051991f46de7d2277d8e36aec0b01d7f5bb8e28b..f698b396b26688fa5838456a377f20a867f62ea1 100644 (file)
@@ -78,7 +78,7 @@ static void nmbd_terminate(int msg_type, pid_t src, void *buf, size_t len)
  Catch a SIGTERM signal.
  **************************************************************************** */
 
-static VOLATILE sig_atomic_t got_sig_term;
+static SIG_ATOMIC_T got_sig_term;
 
 static void sig_term(int sig)
 {
@@ -90,7 +90,7 @@ static void sig_term(int sig)
  Catch a SIGHUP signal.
  **************************************************************************** */
 
-static VOLATILE sig_atomic_t reload_after_sighup;
+static SIG_ATOMIC_T reload_after_sighup;
 
 static void sig_hup(int sig)
 {
index 80f918d1a6c801e2a6813bd38b6d7804a5f7f1d4..9c5b2e1171b2e14380772d4fbbec8e5841f67817 100644 (file)
@@ -56,7 +56,7 @@ struct nisp_enum_info
 };
 
 static struct nisp_enum_info global_nisp_ent;
-static VOLATILE sig_atomic_t gotalarm;
+static SIG_ATOMIC_T gotalarm;
 
 /***************************************************************
 
index 77186ac6c8bb9681807c4288ea097e43d491d135..8454917163a36741db994c4effb3e6975b518ce8 100644 (file)
@@ -24,8 +24,8 @@
 #if HAVE_KERNEL_CHANGE_NOTIFY
 
 #define FD_PENDING_SIZE 20
-static VOLATILE sig_atomic_t fd_pending_array[FD_PENDING_SIZE];
-static VOLATILE sig_atomic_t signals_received;
+static SIG_ATOMIC_T fd_pending_array[FD_PENDING_SIZE];
+static SIG_ATOMIC_T signals_received;
 
 #ifndef DN_ACCESS
 #define DN_ACCESS       0x00000001      /* File accessed in directory */
@@ -71,7 +71,7 @@ struct change_data {
 static void signal_handler(int sig, siginfo_t *info, void *unused)
 {
        if (signals_received < FD_PENDING_SIZE - 1) {
-               fd_pending_array[signals_received] = (sig_atomic_t)info->si_fd;
+               fd_pending_array[signals_received] = (SIG_ATOMIC_T)info->si_fd;
                signals_received++;
        } /* Else signal is lost. */
        sys_select_signal();
@@ -99,10 +99,10 @@ static BOOL kernel_check_notify(connection_struct *conn, uint16 vuid, char *path
                                                path, i, (int)fd_pending_array[i], (int)signals_received ));
 
                        close((int)fd_pending_array[i]);
-                       fd_pending_array[i] = (sig_atomic_t)-1;
+                       fd_pending_array[i] = (SIG_ATOMIC_T)-1;
                        if (signals_received - i - 1) {
-                               memmove(&fd_pending_array[i], &fd_pending_array[i+1],
-                                               sizeof(sig_atomic_t)*(signals_received-i-1));
+                               memmove((void *)&fd_pending_array[i], (void *)&fd_pending_array[i+1],
+                                               sizeof(SIG_ATOMIC_T)*(signals_received-i-1));
                        }
                        data->directory_handle = -1;
                        signals_received--;
@@ -128,10 +128,10 @@ static void kernel_remove_notify(void *datap)
                for (i = 0; i < signals_received; i++) {
                        if (fd == (int)fd_pending_array[i]) {
                                close(fd);
-                               fd_pending_array[i] = (sig_atomic_t)-1;
+                               fd_pending_array[i] = (SIG_ATOMIC_T)-1;
                                if (signals_received - i - 1) {
-                                       memmove(&fd_pending_array[i], &fd_pending_array[i+1],
-                                                       sizeof(sig_atomic_t)*(signals_received-i-1));
+                                       memmove((void *)&fd_pending_array[i], (void *)&fd_pending_array[i+1],
+                                                       sizeof(SIG_ATOMIC_T)*(signals_received-i-1));
                                }
                                data->directory_handle = -1;
                                signals_received--;
index 459d987272cde86aa48b9d3ac7a9a958fb628833..85f89c12a068e555808f91262e4c66132fc972bd 100644 (file)
@@ -22,9 +22,9 @@
 
 #if HAVE_KERNEL_OPLOCKS_LINUX
 
-static VOLATILE sig_atomic_t signals_received;
+static SIG_ATOMIC_T signals_received;
 #define FD_PENDING_SIZE 100
-static VOLATILE sig_atomic_t fd_pending_array[FD_PENDING_SIZE];
+static SIG_ATOMIC_T fd_pending_array[FD_PENDING_SIZE];
 
 #ifndef F_SETLEASE
 #define F_SETLEASE     1024
@@ -53,7 +53,7 @@ static VOLATILE sig_atomic_t fd_pending_array[FD_PENDING_SIZE];
 static void signal_handler(int sig, siginfo_t *info, void *unused)
 {
        if (signals_received < FD_PENDING_SIZE - 1) {
-               fd_pending_array[signals_received] = (sig_atomic_t)info->si_fd;
+               fd_pending_array[signals_received] = (SIG_ATOMIC_T)info->si_fd;
                signals_received++;
        } /* Else signal is lost. */
        sys_select_signal();
@@ -131,10 +131,10 @@ static BOOL linux_oplock_receive_message(fd_set *fds, char *buffer, int buffer_l
        BlockSignals(True, RT_SIGNAL_LEASE);
        fd = fd_pending_array[0];
        fsp = file_find_fd(fd);
-       fd_pending_array[0] = (sig_atomic_t)-1;
+       fd_pending_array[0] = (SIG_ATOMIC_T)-1;
        if (signals_received > 1)
-               memmove(&fd_pending_array[0], &fd_pending_array[1],
-                       sizeof(sig_atomic_t)*(signals_received-1));
+               memmove((void *)&fd_pending_array[0], (void *)&fd_pending_array[1],
+                       sizeof(SIG_ATOMIC_T)*(signals_received-1));
        signals_received--;
        /* now we can receive more signals */
        BlockSignals(False, RT_SIGNAL_LEASE);
index 0cfb4a626460184a2c0d3221a09072a3c987f5f3..43d3c6c53143f37d0f4c3f365df9bc3c7b5de8da 100644 (file)
@@ -42,8 +42,8 @@ extern int last_message;
 extern int global_oplock_break;
 extern userdom_struct current_user_info;
 extern int smb_read_error;
-extern VOLATILE sig_atomic_t reload_after_sighup;
-extern VOLATILE sig_atomic_t got_sig_term;
+SIG_ATOMIC_T reload_after_sighup;
+SIG_ATOMIC_T got_sig_term;
 extern BOOL global_machine_password_needs_changing;
 extern fstring global_myworkgroup;
 extern pstring global_myname;
index 6296e13f1cd908aed54654b0ee8eafaba4ab2e89..107282d36c3dfcdb441cd771f11e08a7e2ea20b3 100644 (file)
@@ -63,7 +63,7 @@ static void smbd_set_server_fd(int fd)
  Terminate signal.
 ****************************************************************************/
 
-VOLATILE sig_atomic_t got_sig_term = 0;
+SIG_ATOMIC_T got_sig_term = 0;
 
 static void sig_term(void)
 {
@@ -75,7 +75,7 @@ static void sig_term(void)
  Catch a sighup.
 ****************************************************************************/
 
-VOLATILE sig_atomic_t reload_after_sighup = 0;
+SIG_ATOMIC_T reload_after_sighup = 0;
 
 static void sig_hup(int sig)
 {