OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 24-Oct-2006 09:17:20
Branch: OPENPKG_2_STABLE Handle: 2006102408171900
Modified files: (Branch: OPENPKG_2_STABLE)
openpkg-src/dcron dcron.patch dcron.spec
Log:
MFC: make more portable and this way finally get it building under Sun
Solaris, too
Summary:
Revision Changes Path
1.4.2.1 +73 -12 openpkg-src/dcron/dcron.patch
1.47.2.3 +1 -1 openpkg-src/dcron/dcron.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/dcron/dcron.patch
============================================================================
$ cvs diff -u -r1.4 -r1.4.2.1 dcron.patch
--- openpkg-src/dcron/dcron.patch 30 Apr 2006 17:32:20 -0000 1.4
+++ openpkg-src/dcron/dcron.patch 24 Oct 2006 07:17:19 -0000 1.4.2.1
@@ -1,15 +1,28 @@
+Index: database.c
+--- database.c.orig 2006-05-16 18:20:01.000000000 +0200
++++ database.c 2006-10-24 09:04:26.497144006 +0200
+@@ -225,7 +225,7 @@
+ if (--maxEntries == 0)
+ break;
+
+- bzero(&line, sizeof(line));
++ memset(&line, 0, sizeof(line));
+
+ if (DebugOpt)
+ log9("User %s Entry %s\n", userName, buf);
Index: defs.h
---- defs.h.orig 2006-04-29 19:20:58 +0200
-+++ defs.h 2006-04-30 19:28:14 +0200
-@@ -23,6 +23,7 @@
+--- defs.h.orig 2006-05-16 18:24:45.000000000 +0200
++++ defs.h 2006-10-24 09:05:15.063043609 +0200
+@@ -22,7 +22,7 @@
+ #include <pwd.h>
#include <unistd.h>
#include <grp.h>
- #include <err.h>
+-#include <err.h>
+#include <sys/termios.h>
#define Prototype extern
#define arysize(ary) (sizeof(ary)/sizeof((ary)[0]))
-@@ -60,6 +61,9 @@
+@@ -60,6 +60,9 @@
#ifndef PATH_VI
#define PATH_VI "/usr/bin/vi" /* location of vi */
#endif
@@ -17,11 +30,18 @@
+#define PIDFILE "/var/run/dcron.pid"
+#endif
- #define VERSION "V3.1"
+ #define VERSION "V3.2"
+
+@@ -93,3 +96,6 @@
+
+ #include "protos.h"
++#define errx my_errx
++#define asprintf my_asprintf
++
Index: main.c
---- main.c.orig 2006-04-29 18:47:26 +0200
-+++ main.c 2006-04-30 19:27:08 +0200
+--- main.c.orig 2006-04-29 18:47:26.000000000 +0200
++++ main.c 2006-10-24 09:00:36.395498701 +0200
@@ -120,8 +120,14 @@
perror("fork");
exit(1);
@@ -39,9 +59,18 @@
/*
Index: subs.c
---- subs.c.orig 2006-04-27 19:29:56 +0200
-+++ subs.c 2006-04-30 19:27:08 +0200
-@@ -79,7 +79,7 @@
+--- subs.c.orig 2006-04-27 19:29:56.000000000 +0200
++++ subs.c 2006-10-24 09:13:53.222197790 +0200
+@@ -15,6 +15,8 @@
+ Prototype int ChangeUser(const char *user, short dochdir);
+ Prototype void vlog(int level, int fd, const char *ctl, va_list va);
+ Prototype int slog(char *buf, const char *ctl, int nmax, va_list va, short
useDate);
++Prototype void my_errx(int eval, const char *fmt, ...);
++Prototype int my_asprintf(char **ret, const char *fmt, ...);
+
+ void
+ log9(const char *ctl, ...)
+@@ -79,7 +81,7 @@
buf[0] = 0;
if (useDate)
@@ -50,7 +79,7 @@
vsnprintf(buf + strlen(buf), nmax, ctl, va);
return(strlen(buf));
}
-@@ -97,9 +97,15 @@
+@@ -97,9 +99,15 @@
logn(9, "failed to get uid for %s", user);
return(-1);
}
@@ -69,3 +98,35 @@
/*
* Change running state to the user in question
+@@ -143,3 +151,31 @@
+ }
+
+ #endif
++
++void errx(int eval, const char *fmt, ...)
++{
++ va_list ap;
++
++ va_start(ap, fmt);
++ vfprintf(stderr, fmt, ap);
++ va_end(ap);
++ exit(eval);
++}
++
++int asprintf(char **ret, const char *fmt, ...)
++{
++ va_list ap;
++ int l;
++
++ va_start(ap, fmt);
++ l = vsnprintf(NULL, 0, fmt, ap);
++ if (((*ret) = (char *)malloc(l+1)) == NULL) {
++ va_end(ap);
++ *ret = NULL;
++ return -1;
++ }
++ l = vsnprintf((*ret), l+1, fmt, ap);
++ va_end(ap);
++ return l;
++}
++
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/dcron/dcron.spec
============================================================================
$ cvs diff -u -r1.47.2.2 -r1.47.2.3 dcron.spec
--- openpkg-src/dcron/dcron.spec 16 Oct 2006 14:49:24 -0000 1.47.2.2
+++ openpkg-src/dcron/dcron.spec 24 Oct 2006 07:17:19 -0000 1.47.2.3
@@ -37,7 +37,7 @@
Group: System
License: GPL
Version: %{V_major}.%{V_minor}
-Release: 2.20061018
+Release: 2.20061024
# list of sources
Source0:
http://apollo.backplane.com/FreeSrc/dcron%{V_major}%{V_minor}.tgz
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]