Skip to content

Commit

Permalink
first run with gcc14 (#72)
Browse files Browse the repository at this point in the history
* first run with gcc14

* fix daemontools for gcc14

* fixed error for bool

* fix ucspi-tcp for gcc14

* dkimsign.cpp: initialize only when len is non-zero

* updated RCS logs
  • Loading branch information
mbhangui authored Jan 21, 2025
1 parent f9632c1 commit 51bb038
Show file tree
Hide file tree
Showing 153 changed files with 3,814 additions and 3,076 deletions.
16 changes: 11 additions & 5 deletions daemontools-x/bool.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
/*
* $Log: bool.h,v $
* Revision 1.1 2004-08-15 19:57:41+05:30 Cprogrammer
* Initial revision
*
* $Id: bool.h,v 1.2 2025-01-21 23:34:56+05:30 Cprogrammer Exp mbhangui $
*/
#ifndef QLOGTOOLS__BOOL__H__
#define QLOGTOOLS__BOOL__H__

typedef int bool;
typedef int mybool;
#define false 0
#define true (0==0)

#endif
/*
* $Log: bool.h,v $
* Revision 1.2 2025-01-21 23:34:56+05:30 Cprogrammer
* Fixes for gcc14
*
* Revision 1.1 2004-08-15 19:57:41+05:30 Cprogrammer
* Initial revision
*
*/
2 changes: 2 additions & 0 deletions daemontools-x/doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ variables
- 04/01/2025
05. daemontools.spec: added provides for installer, instcheck
06. installer.c: fix for missing sys/sysmacros.h for FreeBSD, MacOS
- 22/01/2025
07. Fix errors when using GCC14

* Tue Dec 24 2024 20:28:14 +0000 Manvendra Bhangui <daemontools@indimail.org 1.1.6-1.1%{?dist}
Release 1.1.6-1.1 Start 13/08/2024 End 24/12/2024
Expand Down
79 changes: 43 additions & 36 deletions daemontools-x/inotify.c
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@
/*
* $Log: inotify.c,v $
* Revision 1.12 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.11 2022-01-30 09:53:48+05:30 Cprogrammer
* added missing '/' in display
*
* Revision 1.10 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
* Revision 1.9 2021-05-16 01:42:32+05:30 Cprogrammer
* display full path of directory
*
* Revision 1.8 2021-05-12 13:57:28+05:30 Cprogrammer
* added IN_MOVE_SELF, IN_MOVED_FROm, IN_MOVED_TO events
*
* Revision 1.7 2020-05-11 08:11:47+05:30 Cprogrammer
* fixed shadowing of global variables by local variables
*
* Revision 1.6 2019-06-24 23:29:35+05:30 Cprogrammer
* added notifications for open and delete
*
* Revision 1.5 2017-05-12 19:01:46+05:30 Cprogrammer
* use compile time inotify(7) api
*
* Revision 1.4 2017-05-12 17:58:09+05:30 Cprogrammer
* inotify indimail-mta version
*
* Revision 1.3 2015-04-16 17:49:28+05:30 Cprogrammer
* new logic for handling timeouts
*
* Revision 1.2 2015-04-10 19:32:01+05:30 Cprogrammer
* use select() to read events on fd 0 and event fd
*
* $Id: inotify.c,v 1.13 2025-01-21 23:35:00+05:30 Cprogrammer Exp mbhangui $
*
* This is the sample program to notify us for the file creation and file deletion takes place in “/tmp” directory
*/
Expand Down Expand Up @@ -79,7 +46,7 @@ out(const char *str)
}

no_return void
sigterm()
sigterm(int i)
{
substdio_flush(subfdout);
substdio_flush(subfderr);
Expand Down Expand Up @@ -288,7 +255,47 @@ main(int argc, char **argv)
void
getversion_inotify_c()
{
const char *x = "$Id: inotify.c,v 1.12 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";
const char *x = "$Id: inotify.c,v 1.13 2025-01-21 23:35:00+05:30 Cprogrammer Exp mbhangui $";

x++;
}

/*
* $Log: inotify.c,v $
* Revision 1.13 2025-01-21 23:35:00+05:30 Cprogrammer
* Fixes for gcc14
*
* Revision 1.12 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.11 2022-01-30 09:53:48+05:30 Cprogrammer
* added missing '/' in display
*
* Revision 1.10 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
* Revision 1.9 2021-05-16 01:42:32+05:30 Cprogrammer
* display full path of directory
*
* Revision 1.8 2021-05-12 13:57:28+05:30 Cprogrammer
* added IN_MOVE_SELF, IN_MOVED_FROm, IN_MOVED_TO events
*
* Revision 1.7 2020-05-11 08:11:47+05:30 Cprogrammer
* fixed shadowing of global variables by local variables
*
* Revision 1.6 2019-06-24 23:29:35+05:30 Cprogrammer
* added notifications for open and delete
*
* Revision 1.5 2017-05-12 19:01:46+05:30 Cprogrammer
* use compile time inotify(7) api
*
* Revision 1.4 2017-05-12 17:58:09+05:30 Cprogrammer
* inotify indimail-mta version
*
* Revision 1.3 2015-04-16 17:49:28+05:30 Cprogrammer
* new logic for handling timeouts
*
* Revision 1.2 2015-04-10 19:32:01+05:30 Cprogrammer
* use select() to read events on fd 0 and event fd
*
*/
13 changes: 8 additions & 5 deletions daemontools-x/installer.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: installer.c,v 1.28 2025-01-04 08:46:05+05:30 Cprogrammer Exp mbhangui $
* $Id: installer.c,v 1.29 2025-01-21 23:35:04+05:30 Cprogrammer Exp mbhangui $
* taken from ezmlm-0.54
*/
#include <sys/types.h>
Expand Down Expand Up @@ -565,10 +565,10 @@ doit(stralloc *line, int uninstall, int check)
else
strerr_die4sys(111, FATAL, "unable to read ", name, ": ");
}
substdio_fdbuf(&ssin, read, fdin, inbuf, sizeof (inbuf));
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fdin, inbuf, sizeof (inbuf));
if ((fdout = open_trunc(target.s)) == -1)
strerr_die4sys(111, FATAL, "unable to write ", target.s, ": ");
substdio_fdbuf(&ssout, write, fdout, outbuf, sizeof (outbuf));
substdio_fdbuf(&ssout, (ssize_t (*)(int, char *, size_t)) write, fdout, outbuf, sizeof (outbuf));

if (*type == 'f') {
switch (substdio_copy(&ssout, &ssin))
Expand Down Expand Up @@ -651,7 +651,7 @@ die_usage()
}

char buf[256];
substdio in = SUBSTDIO_FDBUF(read, 0, buf, sizeof (buf));
substdio in = SUBSTDIO_FDBUF((ssize_t (*)(int, char *, size_t)) read, 0, buf, sizeof (buf));
stralloc line = { 0 };

int
Expand Down Expand Up @@ -701,14 +701,17 @@ main(int argc, char **argv)
void
getversion_installer_c()
{
static const char *x = "$Id: installer.c,v 1.28 2025-01-04 08:46:05+05:30 Cprogrammer Exp mbhangui $";
static const char *x = "$Id: installer.c,v 1.29 2025-01-21 23:35:04+05:30 Cprogrammer Exp mbhangui $";

if (x)
x++;
}

/*
* $Log: installer.c,v $
* Revision 1.29 2025-01-21 23:35:04+05:30 Cprogrammer
* Fixes for gcc14
*
* Revision 1.28 2025-01-04 08:46:05+05:30 Cprogrammer
* fix for FreeBSD, MacOS missing sysmacros.h
*
Expand Down
31 changes: 19 additions & 12 deletions daemontools-x/logselect.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
/*
* $Log: logselect.c,v $
* Revision 1.3 2024-05-09 22:40:04+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
* Revision 1.1 2008-06-03 23:23:48+05:30 Cprogrammer
* Initial revision
*
* $Id: logselect.c,v 1.4 2025-01-21 23:35:10+05:30 Cprogrammer Exp mbhangui $
*/
#include <sys/types.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -91,7 +82,7 @@ do_file(char *dirname, char *fn)

if ((fd = open_read(fn)) == -1)
strerr_die6sys(111, FATAL, "unable to read ", dirname, "/", fn, ": ");
substdio_fdbuf(&ssin, read, fd, inbuf, sizeof inbuf);
substdio_fdbuf(&ssin, (ssize_t (*)(int, char *, size_t)) read, fd, inbuf, sizeof inbuf);
for (;;) {
if (!(r = get(&ch)))
break;
Expand Down Expand Up @@ -240,7 +231,23 @@ main(int argc, char **argv)
void
getversion_logselect_c()
{
const char *x = "$Id: logselect.c,v 1.3 2024-05-09 22:40:04+05:30 mbhangui Exp mbhangui $";
const char *x = "$Id: logselect.c,v 1.4 2025-01-21 23:35:10+05:30 Cprogrammer Exp mbhangui $";

x++;
}

/*
* $Log: logselect.c,v $
* Revision 1.4 2025-01-21 23:35:10+05:30 Cprogrammer
* Fixes for gcc14
*
* Revision 1.3 2024-05-09 22:40:04+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2021-08-30 12:04:53+05:30 Cprogrammer
* define funtions as noreturn
*
* Revision 1.1 2008-06-03 23:23:48+05:30 Cprogrammer
* Initial revision
*
*/
19 changes: 11 additions & 8 deletions daemontools-x/multilog.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: multilog.c,v 1.10 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $
* $Id: multilog.c,v 1.11 2025-01-21 23:37:02+05:30 Cprogrammer Exp mbhangui $
*/
#include <unistd.h>
#include <time.h>
Expand Down Expand Up @@ -451,7 +451,7 @@ c_init(char **script)
d->size = size;
d->processor = processor;
d->dir = script[i];
substdio_fdbuf(&d->ss, c_write, d - c, d->buf, sizeof d->buf);
substdio_fdbuf(&d->ss, (ssize_t (*)(int, char *, size_t)) c_write, d - c, d->buf, sizeof d->buf);
restart(d);
++d;
}
Expand Down Expand Up @@ -479,25 +479,25 @@ int flagnewline = 1;
int flaglog = 1;

void
exitasap(void)
exitasap(int i)
{
flagexitasap = 1;
}

void
forcerotate(void)
forcerotate(int i)
{
flagforcerotate = 1;
}

void
logging(void)
logging(int i)
{
flaglog = 1;
}

void
nologging(void)
nologging(int i)
{
flaglog = 0;
}
Expand Down Expand Up @@ -543,7 +543,7 @@ flushread(int fd, char *buf, int len)
}

char inbuf[1024];
substdio ssin = SUBSTDIO_FDBUF(flushread, 0, inbuf, sizeof inbuf);
substdio ssin = SUBSTDIO_FDBUF((ssize_t (*)(int, char *, size_t)) flushread, 0, inbuf, sizeof inbuf);

char line[1001];
int linelen; /*- 0 <= linelen <= 1000 */
Expand Down Expand Up @@ -689,13 +689,16 @@ main(int argc, char **argv)
void
getversion_multilog_c()
{
const char *x = "$Id: multilog.c,v 1.10 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";
const char *x = "$Id: multilog.c,v 1.11 2025-01-21 23:37:02+05:30 Cprogrammer Exp mbhangui $";

x++;
}

/*
* $Log: multilog.c,v $
* Revision 1.11 2025-01-21 23:37:02+05:30 Cprogrammer
* Fixes for gcc14
*
* Revision 1.10 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
Expand Down
49 changes: 28 additions & 21 deletions daemontools-x/multipipe.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
/*
* $Log: multipipe.c,v $
* Revision 1.5 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.4 2020-10-08 12:07:42+05:30 Cprogrammer
* formatted code
*
* Revision 1.3 2011-05-07 15:57:11+05:30 Cprogrammer
* added error checks
*
* Revision 1.2 2004-10-22 20:27:36+05:30 Cprogrammer
* added RCS id
*
* Revision 1.1 2004-07-27 22:56:10+05:30 Cprogrammer
* Initial revision
*
* $Id: multipipe.c,v 1.6 2025-01-21 23:35:21+05:30 Cprogrammer Exp mbhangui $
*
* multipipe -- pipe output to multiple programs
* Copyright (C) 2000 Bruce Guenter <bruceg@em.ca>
Expand Down Expand Up @@ -81,7 +66,7 @@ set_ndelay(int fd)
static char buffer[BUFSIZE];
static unsigned buf_start = 0;
static unsigned buf_end = 0;
static bool buf_eof = false;
static mybool buf_eof = false;
#define buf_wrapped (buf_end < buf_start)
#define buf_left (buf_start-buf_end + (buf_wrapped ? -1 : BUFSIZE-1))
#define buf_len (buf_end-buf_start + (buf_wrapped ? BUFSIZE : 0))
Expand All @@ -93,7 +78,7 @@ struct reader
pid_t pid;
int fd;
unsigned buf_pos;
bool marked;
mybool marked;
struct reader *next;
};

Expand All @@ -103,7 +88,7 @@ void
reset_buf_start(void)
{
struct reader *reader;
bool wrapped = (buf_end < buf_start);
mybool wrapped = (buf_end < buf_start);

buf_start = buf_end;
for (reader = readers; reader; reader = reader->next) {
Expand Down Expand Up @@ -155,7 +140,7 @@ add_reader(const char *name, ino_t inode)
readers = r;
}

bool
mybool
del_reader(pid_t pid)
{
struct reader *curr = readers;
Expand Down Expand Up @@ -404,7 +389,29 @@ main(int argc, char **argv)
void
getversion_multipipe_c()
{
const char *x = "$Id: multipipe.c,v 1.5 2024-05-09 22:39:36+05:30 mbhangui Exp mbhangui $";
const char *x = "$Id: multipipe.c,v 1.6 2025-01-21 23:35:21+05:30 Cprogrammer Exp mbhangui $";

x++;
}

/*
* $Log: multipipe.c,v $
* Revision 1.6 2025-01-21 23:35:21+05:30 Cprogrammer
* Fixes for gcc14
*
* Revision 1.5 2024-05-09 22:39:36+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.4 2020-10-08 12:07:42+05:30 Cprogrammer
* formatted code
*
* Revision 1.3 2011-05-07 15:57:11+05:30 Cprogrammer
* added error checks
*
* Revision 1.2 2004-10-22 20:27:36+05:30 Cprogrammer
* added RCS id
*
* Revision 1.1 2004-07-27 22:56:10+05:30 Cprogrammer
* Initial revision
*
*/
Loading

0 comments on commit 51bb038

Please sign in to comment.