Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37530375
en ru br
ALT Linux repos
S:0.72.0-alt1
5.0: 0.61.0-alt1
4.1: 0.60.2-alt1
4.0: 0.59.1-alt1.0
3.0: 0.56-alt1

Group :: System/Libraries
RPM: courier-authlib

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: courier-authlib-0.59.1-alt-addlock.patch
Download


diff -ruN courier-authlib-0.59.1.orig/liblog/logger.c courier-authlib-0.59.1/liblog/logger.c
--- courier-authlib-0.59.1.orig/liblog/logger.c	2006-06-01 21:47:33 +1100
+++ courier-authlib-0.59.1/liblog/logger.c	2007-01-28 00:58:24 +1000
@@ -107,6 +107,7 @@
 
 static const char *namearg=0;
 static const char *pidarg=0;
+static const char *lockarg=0;
 static char *lockfilename=0;
 
 struct lognames
@@ -380,7 +381,7 @@
 	{
 		fprintf(stderr,
 
-			"Usage: courierlogger [-name=name] [-pid=pidfile] [-facility=type]\n"
+			"Usage: courierlogger [-name=name] [-pid=pidfile] [-lock=lockfile] [-facility=type]\n"
 			"       [-start|-stop|-restart] [cmd [args...]]\n"
 		);
 		exit(1);
@@ -392,13 +393,18 @@
 		if (strncmp(argv[0],"-pid=",5) == 0 && argv[0][5])
 		{
 			pidarg=&argv[0][5];
-			lockfilename=malloc(strlen(pidarg)+sizeof(".lock"));
+		}
+		else
+		if (strncmp(argv[0],"-lock=",6) == 0 && argv[0][6])
+		{
+			lockarg=&argv[0][6];
+			lockfilename=malloc(strlen(lockarg));
 			if (!lockfilename)
 			{
 				perror("malloc");
 				exit(1);
 			}
-			strcat(strcpy(lockfilename, pidarg), ".lock");
+			strcpy(lockfilename, lockarg);
 		}
 		else
 		if (strncmp(argv[0],"-name=",6) == 0 && argv[0][6])
@@ -444,6 +450,16 @@
 		argv++, argc--;
 	}
 
+	if (pidarg && !lockarg) {
+			lockfilename=malloc(strlen(pidarg)+sizeof(".lock"));
+			if (!lockfilename)
+			{
+				perror("malloc");
+				exit(1);
+			}
+			strcat(strcpy(lockfilename, pidarg), ".lock");
+	}
+
 	if (daemon && !pidarg)
 	{
 		fprintf(stderr, "-pid argument required\n");
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin