[Nagios-devel] [PATCH] ndoutils: fix fmt specifier in

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH] ndoutils: fix fmt specifier in

Post by Guest »


--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

Either lock.l_pid should not be printed or it needs a format specifier.

Attached patch does the latter.
thanks,
Bernhard

--FCuugMFkClbJLl1L
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="ndoutils-ndo2db_daemonize-fmt.01.patch"

------------------------------------------------------------------------
r66 | aldot | 2009-04-01 14:14:33 +0200 (Wed, 01 Apr 2009) | 2 lines

- print the PID of the other instance. Fixes warning about too many arguments for format.

------------------------------------------------------------------------

Index: src/ndo2db.c
===================================================================
--- src/ndo2db.c (revision 65)
+++ src/ndo2db.c (revision 66)
@@ -593,7 +593,7 @@ int ndo2db_daemonize(void){
if(fcntl(lockfile,F_SETLK,&lock)<0){
if(errno==EACCES || errno==EAGAIN){
fcntl(lockfile,F_GETLK,&lock);
- asprintf(&msg,"Lockfile '%s' looks like its already held by another instance. Bailing out...",lock_file,(int)lock.l_pid);
+ asprintf(&msg,"Lockfile '%s' looks like its already held by another instance (%d). Bailing out...",lock_file,(int)lock.l_pid);
}
else
asprintf(&msg,"Cannot lock lockfile '%s': %s. Bailing out...",lock_file,strerror(errno));

--FCuugMFkClbJLl1L--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked