projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Note in dist, mh-profile, and repl man pages that the @ link
[mmh]
/
uip
/
slocal.c
diff --git
a/uip/slocal.c
b/uip/slocal.c
index
71e09ff
..
a7283bf
100644
(file)
--- a/
uip/slocal.c
+++ b/
uip/slocal.c
@@
-51,7
+51,9
@@
#include NDBM_HEADER
#endif
#include NDBM_HEADER
#endif
+#ifdef HAVE_GETUTXENT
#include <utmpx.h>
#include <utmpx.h>
+#endif /* HAVE_GETUTXENT */
static struct swit switches[] = {
#define ADDRSW 0
static struct swit switches[] = {
#define ADDRSW 0
@@
-220,13
+222,12
@@
main (int argc, char **argv)
adios (NULL, "-%s unknown", cp);
case HELPSW:
adios (NULL, "-%s unknown", cp);
case HELPSW:
- snprintf (buf, sizeof(buf),
- "%s [switches] [address info sender]", invo_name);
+ snprintf (buf, sizeof(buf), "%s [switches]", invo_name);
print_help (buf, switches, 0);
print_help (buf, switches, 0);
- done (1);
+ done (0);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- done (1);
+ done (0);
case ADDRSW:
if (!(addr = *argp++))/* allow -xyz arguments */
case ADDRSW:
if (!(addr = *argp++))/* allow -xyz arguments */
@@
-282,20
+283,8
@@
main (int argc, char **argv)
debug++;
continue;
}
debug++;
continue;
}
- }
-
- switch (argp - (argv + 1)) {
- case 1:
- addr = cp;
- break;
-
- case 2:
- info = cp;
- break;
-
- case 3:
- sender = cp;
- break;
+ } else {
+ adios (NULL, "only switch arguments are supported");
}
}
}
}
@@
-930,6
+919,7
@@
lookup (struct pair *pairs, char *key)
static int
logged_in (void)
{
static int
logged_in (void)
{
+#if HAVE_GETUTXENT
struct utmpx *utp;
if (utmped)
struct utmpx *utp;
if (utmped)
@@
-948,6
+938,7
@@
logged_in (void)
}
endutxent();
}
endutxent();
+#endif /* HAVE_GETUTXENT */
return (utmped = NOTOK);
}
return (utmped = NOTOK);
}