SCCS-vsn: usr.bin/xinstall/xinstall.c 5.14
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)xinstall.c 5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)xinstall.c 5.14 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
#include <pwd.h>
#include <stdio.h>
#include <ctype.h>
#include <pwd.h>
#include <stdio.h>
#include <ctype.h>
-
-#define YES 1 /* yes/true */
-#define NO 0 /* no/false */
#define PERROR(head, msg) { \
fputs(head, stderr); \
#define PERROR(head, msg) { \
fputs(head, stderr); \
while ((ch = getopt(argc, argv, "cg:m:o:s")) != EOF)
switch((char)ch) {
case 'c':
while ((ch = getopt(argc, argv, "cg:m:o:s")) != EOF)
switch((char)ch) {
case 'c':
break;
case 'g':
group = optarg;
break;
case 'g':
group = optarg;
owner = optarg;
break;
case 's':
owner = optarg;
break;
case 's':
break;
case '?':
default:
break;
case '?':
default:
no_target = stat(to_name = argv[argc - 1], &to_sb);
if (!no_target && (to_sb.st_mode & S_IFMT) == S_IFDIR) {
for (; *argv != to_name; ++argv)
no_target = stat(to_name = argv[argc - 1], &to_sb);
if (!no_target && (to_sb.st_mode & S_IFMT) == S_IFDIR) {
for (; *argv != to_name; ++argv)
- install(*argv, to_name, YES);
+ install(*argv, to_name, 1);
/* unlink now... avoid ETXTBSY errors later */
(void)unlink(to_name);
}
/* unlink now... avoid ETXTBSY errors later */
(void)unlink(to_name);
}
- install(*argv, to_name, NO);
+ install(*argv, to_name, 0);
int devnull, from_fd, to_fd;
char *C, *rindex();
int devnull, from_fd, to_fd;
char *C, *rindex();
- /* if try to install "/dev/null" to a directory, fails */
- if (isdir || strcmp(from_name, "/dev/null")) {
+ /* if try to install NULL file to a directory, fails */
+ if (isdir || strcmp(from_name, _PATH_DEVNULL)) {
if (stat(from_name, &from_sb)) {
fprintf(stderr, "install: can't find %s.\n", from_name);
exit(1);
if (stat(from_name, &from_sb)) {
fprintf(stderr, "install: can't find %s.\n", from_name);
exit(1);
(void)sprintf(pathbuf, "%s/%s", to_name, (C = rindex(from_name, '/')) ? ++C : from_name);
to_name = pathbuf;
}
(void)sprintf(pathbuf, "%s/%s", to_name, (C = rindex(from_name, '/')) ? ++C : from_name);
to_name = pathbuf;
}
/* unlink now... avoid ETXTBSY errors later */
(void)unlink(to_name);
/* unlink now... avoid ETXTBSY errors later */
(void)unlink(to_name);