Wed Oct 14 16:00:18 2015 UTC ()
use syslog attribute


(christos)
diff -r1.1.1.3 -r1.2 src/external/bsd/am-utils/dist/include/am_utils.h

cvs diff -r1.1.1.3 -r1.2 src/external/bsd/am-utils/dist/include/am_utils.h (expand / switch to unified diff)

--- src/external/bsd/am-utils/dist/include/am_utils.h 2015/01/17 16:34:18 1.1.1.3
+++ src/external/bsd/am-utils/dist/include/am_utils.h 2015/10/14 16:00:17 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: am_utils.h,v 1.1.1.3 2015/01/17 16:34:18 christos Exp $ */ 1/* $NetBSD: am_utils.h,v 1.2 2015/10/14 16:00:17 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997-2014 Erez Zadok 4 * Copyright (c) 1997-2014 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry 5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California. 7 * Copyright (c) 1990 The Regents of the University of California.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This code is derived from software contributed to Berkeley by 10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London. 11 * Jan-Simon Pendry at Imperial College, London.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -43,26 +43,30 @@ @@ -43,26 +43,30 @@
43 * Definitions that are specific to the am-utils package. 43 * Definitions that are specific to the am-utils package.
44 */ 44 */
45 45
46#ifndef _AM_UTILS_H 46#ifndef _AM_UTILS_H
47#define _AM_UTILS_H 47#define _AM_UTILS_H
48 48
49 49
50#include "aux_conf.h" 50#include "aux_conf.h"
51 51
52/**************************************************************************/ 52/**************************************************************************/
53/*** MACROS ***/ 53/*** MACROS ***/
54/**************************************************************************/ 54/**************************************************************************/
55 55
 56#if !defined(__syslog_attribute__) && !defined(__syslog__)
 57#define __syslog__ __printf__
 58#endif
 59
56/* 60/*
57 * General macros. 61 * General macros.
58 */ 62 */
59#ifndef FALSE 63#ifndef FALSE
60# define FALSE 0 64# define FALSE 0
61#endif /* not FALSE */ 65#endif /* not FALSE */
62#ifndef TRUE 66#ifndef TRUE
63# define TRUE 1 67# define TRUE 1
64#endif /* not TRUE */ 68#endif /* not TRUE */
65#ifndef MAX 69#ifndef MAX
66# define MAX(a, b) ((a) > (b) ? (a) : (b)) 70# define MAX(a, b) ((a) > (b) ? (a) : (b))
67#endif /* not MAX */ 71#endif /* not MAX */
68#ifndef MIN 72#ifndef MIN
@@ -314,27 +318,27 @@ extern mntlist *read_mtab(char *, const  @@ -314,27 +318,27 @@ extern mntlist *read_mtab(char *, const
314#ifndef HAVE_TRANSPORT_TYPE_TLI 318#ifndef HAVE_TRANSPORT_TYPE_TLI
315extern struct sockaddr_in *amu_svc_getcaller(SVCXPRT *xprt); 319extern struct sockaddr_in *amu_svc_getcaller(SVCXPRT *xprt);
316#endif /* not HAVE_TRANSPORT_TYPE_TLI */ 320#endif /* not HAVE_TRANSPORT_TYPE_TLI */
317extern time_t time(time_t *); 321extern time_t time(time_t *);
318extern void amu_get_myaddress(struct in_addr *iap, const char *preferred_localhost); 322extern void amu_get_myaddress(struct in_addr *iap, const char *preferred_localhost);
319extern void amu_release_controlling_tty(void); 323extern void amu_release_controlling_tty(void);
320extern void compute_automounter_nfs_args(nfs_args_t *nap, mntent_t *mntp); 324extern void compute_automounter_nfs_args(nfs_args_t *nap, mntent_t *mntp);
321extern void discard_mntlist(mntlist *mp); 325extern void discard_mntlist(mntlist *mp);
322extern void free_mntlist(mntlist *); 326extern void free_mntlist(mntlist *);
323extern void getwire(char **name1, char **number1); 327extern void getwire(char **name1, char **number1);
324extern void going_down(int); 328extern void going_down(int);
325extern void mnt_free(mntent_t *); 329extern void mnt_free(mntent_t *);
326extern void plog(int, const char *,...) 330extern void plog(int, const char *,...)
327 __attribute__ ((__format__ (__printf__, 2, 3))); 331 __attribute__ ((__format__ (__syslog__, 2, 3)));
328extern void rmdirs(char *); 332extern void rmdirs(char *);
329extern void rpc_msg_init(struct rpc_msg *, u_long, u_long, u_long); 333extern void rpc_msg_init(struct rpc_msg *, u_long, u_long, u_long);
330extern void set_amd_program_number(u_long program); 334extern void set_amd_program_number(u_long program);
331extern void show_opts(int ch, struct opt_tab *); 335extern void show_opts(int ch, struct opt_tab *);
332extern void unregister_amq(void); 336extern void unregister_amq(void);
333extern voidp xmalloc(int); 337extern voidp xmalloc(int);
334extern voidp xrealloc(voidp, int); 338extern voidp xrealloc(voidp, int);
335extern voidp xzalloc(int); 339extern voidp xzalloc(int);
336extern char *xstrdup(const char *); 340extern char *xstrdup(const char *);
337extern int check_pmap_up(char *host, struct sockaddr_in* sin); 341extern int check_pmap_up(char *host, struct sockaddr_in* sin);
338extern u_long get_nfs_version(char *host, struct sockaddr_in *sin, u_long nfs_version, const char *proto, u_long def); 342extern u_long get_nfs_version(char *host, struct sockaddr_in *sin, u_long nfs_version, const char *proto, u_long def);
339extern int nfs_valid_version(u_long vers); 343extern int nfs_valid_version(u_long vers);
340extern long get_server_pid(void); 344extern long get_server_pid(void);
@@ -479,27 +483,27 @@ extern void dxfree(char *file, int line, @@ -479,27 +483,27 @@ extern void dxfree(char *file, int line,
479extern void malloc_verify(void); 483extern void malloc_verify(void);
480# else /* not DEBUG_MEM */ 484# else /* not DEBUG_MEM */
481/* 485/*
482 * If regular debugging, then free the pointer and reset to NULL. 486 * If regular debugging, then free the pointer and reset to NULL.
483 * This should remain so for as long as am-utils is in alpha/beta testing. 487 * This should remain so for as long as am-utils is in alpha/beta testing.
484 */ 488 */
485# define XFREE(x) do { free((voidp)x); x = NULL;} while (0) 489# define XFREE(x) do { free((voidp)x); x = NULL;} while (0)
486# endif /* not DEBUG_MEM */ 490# endif /* not DEBUG_MEM */
487 491
488/* functions that depend solely on debugging */ 492/* functions that depend solely on debugging */
489extern void print_nfs_args(const void *, u_long nfs_version); 493extern void print_nfs_args(const void *, u_long nfs_version);
490extern int debug_option (char *opt); 494extern int debug_option (char *opt);
491extern void dplog(const char *fmt, ...) 495extern void dplog(const char *fmt, ...)
492 __attribute__ ((__format__ (__printf__, 1, 2))); 496 __attribute__ ((__format__ (__syslog__, 1, 2)));
493 497
494#else /* not DEBUG */ 498#else /* not DEBUG */
495 499
496/* set dummy flags to zero */ 500/* set dummy flags to zero */
497# define D_DAEMON 0x0001 /* Enter daemon mode */ 501# define D_DAEMON 0x0001 /* Enter daemon mode */
498# define D_TRACE 0x0000 /* dummy: Do protocol trace */ 502# define D_TRACE 0x0000 /* dummy: Do protocol trace */
499# define D_FULL 0x0000 /* dummy: Do full trace */ 503# define D_FULL 0x0000 /* dummy: Do full trace */
500# define D_MTAB 0x0000 /* dummy: Use local mtab */ 504# define D_MTAB 0x0000 /* dummy: Use local mtab */
501# define D_AMQ 0x0010 /* Register amq program */ 505# define D_AMQ 0x0010 /* Register amq program */
502# define D_STR 0x0000 /* dummy: Debug string munging */ 506# define D_STR 0x0000 /* dummy: Debug string munging */
503# define D_MEM 0x0000 /* dummy: Trace memory allocations */ 507# define D_MEM 0x0000 /* dummy: Trace memory allocations */
504# define D_FORK 0x0080 /* Fork server (hlfsd only) */ 508# define D_FORK 0x0080 /* Fork server (hlfsd only) */
505# define D_INFO 0x0000 /* dummy: info service debugging */ 509# define D_INFO 0x0000 /* dummy: info service debugging */