Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/ftp define private type `sigfunc' as
details: https://anonhg.NetBSD.org/src/rev/b4b067a193cc
branches: trunk
changeset: 481477:b4b067a193cc
user: lukem <lukem%NetBSD.org@localhost>
date: Mon Jan 31 22:01:03 2000 +0000
description:
define private type `sigfunc' as
typedef void (*sigfunc) __P((int));
and replace use of sig_t and void (*)(int).
certain other OSes define sig_t differently to that (they add extra arguments),
and it causes problems due to function mismatches, etc...
diffstat:
usr.bin/ftp/cmds.c | 18 +++++++++---------
usr.bin/ftp/extern.h | 6 +++---
usr.bin/ftp/fetch.c | 6 +++---
usr.bin/ftp/ftp.c | 16 ++++++++--------
usr.bin/ftp/ftp_var.h | 4 +++-
usr.bin/ftp/util.c | 12 ++++++------
6 files changed, 32 insertions(+), 30 deletions(-)
diffs (259 lines):
diff -r 3b2d26ee5e9c -r b4b067a193cc usr.bin/ftp/cmds.c
--- a/usr.bin/ftp/cmds.c Mon Jan 31 21:08:11 2000 +0000
+++ b/usr.bin/ftp/cmds.c Mon Jan 31 22:01:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cmds.c,v 1.81 1999/12/05 22:54:35 lukem Exp $ */
+/* $NetBSD: cmds.c,v 1.82 2000/01/31 22:01:03 lukem Exp $ */
/*-
* Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: cmds.c,v 1.81 1999/12/05 22:54:35 lukem Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.82 2000/01/31 22:01:03 lukem Exp $");
#endif
#endif /* not lint */
@@ -458,7 +458,7 @@
char *argv[];
{
int i;
- sig_t oldintr;
+ sigfunc oldintr;
int ointer;
char *tp;
@@ -691,7 +691,7 @@
int argc;
char *argv[];
{
- sig_t oldintr;
+ sigfunc oldintr;
int ch, ointer;
char *cp, *tp, *tp2, tmpbuf[MAXPATHLEN];
@@ -1209,7 +1209,7 @@
int argc;
char *argv[];
{
- sig_t oldintr;
+ sigfunc oldintr;
int ointer;
char *cp;
@@ -1346,7 +1346,7 @@
int argc;
char *argv[];
{
- sig_t oldintr;
+ sigfunc oldintr;
int ointer, i;
int dolist;
char mode[1], *dest, *odest;
@@ -1404,7 +1404,7 @@
char *argv[];
{
pid_t pid;
- sig_t old1;
+ sigfunc old1;
char shellnam[MAXPATHLEN], *shell, *namep;
int wait_status;
@@ -1831,7 +1831,7 @@
{
struct cmd *c;
int cmdpos;
- sig_t oldintr;
+ sigfunc oldintr;
if ((argc == 0 && argv != NULL) ||
(argc == 1 && !another(&argc, &argv, "command"))) {
@@ -2259,7 +2259,7 @@
int cmdlineopt;
{
int dir, max, incr, showonly;
- sig_t oldusr1, oldusr2;
+ sigfunc oldusr1, oldusr2;
if (argc > 4 || (argc < (cmdlineopt ? 3 : 2))) {
usage:
diff -r 3b2d26ee5e9c -r b4b067a193cc usr.bin/ftp/extern.h
--- a/usr.bin/ftp/extern.h Mon Jan 31 21:08:11 2000 +0000
+++ b/usr.bin/ftp/extern.h Mon Jan 31 22:01:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.51 1999/11/28 06:32:05 lukem Exp $ */
+/* $NetBSD: extern.h,v 1.52 2000/01/31 22:01:04 lukem Exp $ */
/*-
* Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
@@ -253,5 +253,5 @@
StringList *xsl_init __P((void));
void xsl_add __P((StringList *, char *));
char *xstrdup __P((const char *));
-sig_t xsignal __P((int, void (func) __P((int))));
-sig_t xsignal_restart __P((int, void (func) __P((int)), int));
+sigfunc xsignal __P((int, sigfunc));
+sigfunc xsignal_restart __P((int, sigfunc, int));
diff -r 3b2d26ee5e9c -r b4b067a193cc usr.bin/ftp/fetch.c
--- a/usr.bin/ftp/fetch.c Mon Jan 31 21:08:11 2000 +0000
+++ b/usr.bin/ftp/fetch.c Mon Jan 31 22:01:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fetch.c,v 1.103 2000/01/25 07:13:45 lukem Exp $ */
+/* $NetBSD: fetch.c,v 1.104 2000/01/31 22:01:04 lukem Exp $ */
/*-
* Copyright (c) 1997-1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.103 2000/01/25 07:13:45 lukem Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.104 2000/01/31 22:01:04 lukem Exp $");
#endif /* not lint */
/*
@@ -459,7 +459,7 @@
struct sockaddr_in sin;
struct hostent *hp = NULL;
#endif
- volatile sig_t oldintr, oldintp;
+ volatile sigfunc oldintr, oldintp;
volatile int s;
struct stat sb;
int ischunked, isproxy, rval, hcode;
diff -r 3b2d26ee5e9c -r b4b067a193cc usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Mon Jan 31 21:08:11 2000 +0000
+++ b/usr.bin/ftp/ftp.c Mon Jan 31 22:01:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.89 1999/12/11 02:02:21 lukem Exp $ */
+/* $NetBSD: ftp.c,v 1.90 2000/01/31 22:01:04 lukem Exp $ */
/*-
* Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$NetBSD: ftp.c,v 1.89 1999/12/11 02:02:21 lukem Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.90 2000/01/31 22:01:04 lukem Exp $");
#endif
#endif /* not lint */
@@ -432,7 +432,7 @@
{
va_list ap;
int r;
- sig_t oldsigint;
+ sigfunc oldsigint;
#ifndef __STDC__
const char *fmt;
#endif
@@ -490,7 +490,7 @@
int c, n, line;
int dig;
int originalcode = 0, continuation = 0;
- sig_t oldsigint, oldsigalrm;
+ sigfunc oldsigint, oldsigalrm;
int pflag = 0;
char *cp, *pt = pasv;
@@ -733,7 +733,7 @@
int c, d;
FILE *fin, *dout;
int (*closefunc) __P((FILE *));
- sig_t oldintr, oldintp;
+ sigfunc oldintr, oldintp;
volatile off_t hashbytes;
char *lmode, *bufp;
static size_t bufsize;
@@ -1035,7 +1035,7 @@
{
FILE *fout, *din;
int (*closefunc) __P((FILE *));
- sig_t oldintr, oldintp;
+ sigfunc oldintr, oldintp;
int c, d;
volatile int is_retr, tcrflag, bare_lfs;
static size_t bufsize;
@@ -1848,7 +1848,7 @@
pswitch(flag)
int flag;
{
- sig_t oldintr;
+ sigfunc oldintr;
static struct comvars {
int connect;
char name[MAXHOSTNAMELEN];
@@ -1950,7 +1950,7 @@
proxtrans(cmd, local, remote)
const char *cmd, *local, *remote;
{
- sig_t oldintr;
+ sigfunc oldintr;
int prox_type, nfnd;
volatile int secndflag;
char *cmd2;
diff -r 3b2d26ee5e9c -r b4b067a193cc usr.bin/ftp/ftp_var.h
--- a/usr.bin/ftp/ftp_var.h Mon Jan 31 21:08:11 2000 +0000
+++ b/usr.bin/ftp/ftp_var.h Mon Jan 31 22:01:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp_var.h,v 1.51 1999/12/05 22:54:36 lukem Exp $ */
+/* $NetBSD: ftp_var.h,v 1.52 2000/01/31 22:01:05 lukem Exp $ */
/*-
* Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
@@ -123,6 +123,8 @@
#include <histedit.h>
#endif /* !NO_EDITCOMPLETE */
+typedef void (*sigfunc) __P((int));
+
#include "extern.h"
diff -r 3b2d26ee5e9c -r b4b067a193cc usr.bin/ftp/util.c
--- a/usr.bin/ftp/util.c Mon Jan 31 21:08:11 2000 +0000
+++ b/usr.bin/ftp/util.c Mon Jan 31 22:01:03 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: util.c,v 1.90 2000/01/26 11:31:55 lukem Exp $ */
+/* $NetBSD: util.c,v 1.91 2000/01/31 22:01:05 lukem Exp $ */
/*-
* Copyright (c) 1997-1999 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: util.c,v 1.90 2000/01/26 11:31:55 lukem Exp $");
+__RCSID("$NetBSD: util.c,v 1.91 2000/01/31 22:01:05 lukem Exp $");
#endif /* not lint */
/*
@@ -1512,10 +1512,10 @@
* Install a POSIX signal handler, allowing the invoker to set whether
* the signal should be restartable or not
*/
-sig_t
+sigfunc
xsignal_restart(sig, func, restartable)
int sig;
- void (*func) __P((int));
+ sigfunc func;
int restartable;
{
struct sigaction act, oact;
@@ -1538,10 +1538,10 @@
* Install a signal handler with the `restartable' flag set dependent upon
* which signal is being set. (This is a wrapper to xsignal_restart())
*/
-sig_t
+sigfunc
xsignal(sig, func)
int sig;
- void (*func) __P((int));
+ sigfunc func;
{
int restartable;
Home |
Main Index |
Thread Index |
Old Index