Author: vlendec Date: 2005-08-27 07:44:26 +0000 (Sat, 27 Aug 2005) New Revision: 9675
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9675 Log: Change calling convention for process_exists. Volker Modified: branches/tmp/vl-cluster/source/lib/util.c branches/tmp/vl-cluster/source/locking/brlock.c branches/tmp/vl-cluster/source/locking/locking.c branches/tmp/vl-cluster/source/smbd/connection.c branches/tmp/vl-cluster/source/utils/net_status.c branches/tmp/vl-cluster/source/utils/status.c branches/tmp/vl-cluster/source/web/statuspage.c Changeset: Modified: branches/tmp/vl-cluster/source/lib/util.c =================================================================== --- branches/tmp/vl-cluster/source/lib/util.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/lib/util.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -1404,23 +1404,22 @@ Check if a process exists. Does this work on all unixes? ****************************************************************************/ -BOOL process_exists(const struct process_id *pid) +BOOL process_exists(const struct process_id pid) { - if (!procid_is_local(pid)) { + if (!procid_is_local(&pid)) { /* This *SEVERELY* needs fixing. */ return True; } /* Doing kill with a non-positive pid causes messages to be * sent to places we don't want. */ - SMB_ASSERT(pid->pid > 0); - return(kill(pid->pid,0) == 0 || errno != ESRCH); + SMB_ASSERT(pid.pid > 0); + return(kill(pid.pid,0) == 0 || errno != ESRCH); } BOOL process_exists_by_pid(pid_t pid) { - struct process_id tmp = pid_to_procid(pid); - return process_exists(&tmp); + return process_exists(pid_to_procid(pid)); } /******************************************************************* Modified: branches/tmp/vl-cluster/source/locking/brlock.c =================================================================== --- branches/tmp/vl-cluster/source/locking/brlock.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/locking/brlock.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -252,7 +252,7 @@ DEBUG(0,("brlock : delete_fn. LOGIC ERROR ! Shutting down and a record for my pid (%u) exists !\n", (unsigned int)lock->context.pid )); - } else if (process_exists(lock->context.pid)) { + } else if (process_exists(&lock->context.pid)) { DEBUG(10,("brlock : delete_fn. pid %u exists.\n", (unsigned int)lock->context.pid )); continue; Modified: branches/tmp/vl-cluster/source/locking/locking.c =================================================================== --- branches/tmp/vl-cluster/source/locking/locking.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/locking/locking.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -548,7 +548,7 @@ for (i = 0; i < num_share_modes; ) { share_mode_entry *entry_p = &shares[i]; - if (process_exists(&entry_p->pid)) { + if (process_exists(entry_p->pid)) { DEBUG(10,("get_share_modes: %s\n", share_mode_str(i, entry_p) )); i++; } else { @@ -1087,7 +1087,7 @@ for (i = 0; i < num_de_entries; ) { deferred_open_entry *entry_p = &de_entries[i]; - if (process_exists(&entry_p->pid)) { + if (process_exists(entry_p->pid)) { DEBUG(10,("get_deferred_opens: %s\n", deferred_open_str(i, entry_p) )); i++; } else { Modified: branches/tmp/vl-cluster/source/smbd/connection.c =================================================================== --- branches/tmp/vl-cluster/source/smbd/connection.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/smbd/connection.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -106,7 +106,7 @@ /* If the pid was not found delete the entry from connections.tdb */ - if (cs->Clear && !process_exists(&crec.pid) && (errno == ESRCH)) { + if (cs->Clear && !process_exists(crec.pid) && (errno == ESRCH)) { DEBUG(2,("pid %s doesn't exist - deleting connections %d [%s]\n", procid_str_static(&crec.pid), crec.cnum, crec.name)); if (tdb_delete(the_tdb, kbuf) != 0) Modified: branches/tmp/vl-cluster/source/utils/net_status.c =================================================================== --- branches/tmp/vl-cluster/source/utils/net_status.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/utils/net_status.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -25,15 +25,13 @@ { BOOL *parseable = (BOOL *)state; struct sessionid sessionid; - struct process_id tmp; if (dbuf.dsize != sizeof(sessionid)) return 0; memcpy(&sessionid, dbuf.dptr, sizeof(sessionid)); - tmp = pid_to_procid(sessionid.pid); - if (!process_exists(&tmp)) { + if (!process_exists_by_pid(sessionid.pid)) { return 0; } @@ -99,7 +97,7 @@ if (crec.cnum == -1) return 0; - if (!process_exists(&crec.pid)) { + if (!process_exists(crec.pid)) { return 0; } @@ -121,15 +119,13 @@ { struct sessionids *ids = (struct sessionids *)state; struct sessionid sessionid; - struct process_id tmp; if (dbuf.dsize != sizeof(sessionid)) return 0; memcpy(&sessionid, dbuf.dptr, sizeof(sessionid)); - tmp = pid_to_procid(sessionid.pid); - if (!process_exists(&tmp)) + if (!process_exists_by_pid(sessionid.pid)) return 0; ids->num_entries += 1; @@ -155,7 +151,7 @@ if (crec.cnum == -1) return 0; - if (!process_exists(&crec.pid)) { + if (!process_exists(crec.pid)) { return 0; } Modified: branches/tmp/vl-cluster/source/utils/status.c =================================================================== --- branches/tmp/vl-cluster/source/utils/status.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/utils/status.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -545,7 +545,7 @@ if (crec.cnum == -1) return 0; - if (!process_exists(&crec.pid) || !Ucrit_checkUid(crec.uid)) { + if (!process_exists(crec.pid) || !Ucrit_checkUid(crec.uid)) { return 0; } @@ -561,15 +561,13 @@ { struct sessionid sessionid; fstring uid_str, gid_str; - struct process_id tmp; if (dbuf.dsize != sizeof(sessionid)) return 0; memcpy(&sessionid, dbuf.dptr, sizeof(sessionid)); - tmp = pid_to_procid(sessionid.pid); - if (!process_exists(&tmp) || !Ucrit_checkUid(sessionid.uid)) { + if (!process_exists_by_pid(sessionid.pid) || !Ucrit_checkUid(sessionid.uid)) { return 0; } Modified: branches/tmp/vl-cluster/source/web/statuspage.c =================================================================== --- branches/tmp/vl-cluster/source/web/statuspage.c 2005-08-27 06:29:12 UTC (rev 9674) +++ branches/tmp/vl-cluster/source/web/statuspage.c 2005-08-27 07:44:26 UTC (rev 9675) @@ -166,7 +166,7 @@ memcpy(&crec, dbuf.dptr, sizeof(crec)); - if (crec.cnum == -1 && process_exists(&crec.pid)) { + if (crec.cnum == -1 && process_exists(crec.pid)) { char buf[30]; slprintf(buf,sizeof(buf)-1,"kill_%s", procid_str_static(&crec.pid)); if (cgi_variable(buf)) { @@ -187,7 +187,7 @@ memcpy(&crec, dbuf.dptr, sizeof(crec)); - if (crec.cnum == -1 || !process_exists(&crec.pid) || + if (crec.cnum == -1 || !process_exists(crec.pid) || procid_equal(&crec.pid, &smbd_pid)) return 0; @@ -216,7 +216,7 @@ memcpy(&crec, dbuf.dptr, sizeof(crec)); - if (crec.cnum == -1 || !process_exists(&crec.pid)) + if (crec.cnum == -1 || !process_exists(crec.pid)) return 0; printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
