=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/xinstall/xinstall.c,v retrieving revision 1.63 retrieving revision 1.64 diff -c -r1.63 -r1.64 *** src/usr.bin/xinstall/xinstall.c 2015/12/31 16:16:54 1.63 --- src/usr.bin/xinstall/xinstall.c 2016/05/12 21:43:27 1.64 *************** *** 1,4 **** ! /* $OpenBSD: xinstall.c,v 1.63 2015/12/31 16:16:54 millert Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: xinstall.c,v 1.64 2016/05/12 21:43:27 millert Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* *************** *** 56,61 **** --- 56,62 ---- #define DIRECTORY 0x01 /* Tell install it's a directory. */ #define SETFLAGS 0x02 /* Tell install to set flags. */ + #define USEFSYNC 0x04 /* Tell install to use fsync(2). */ #define NOCHANGEBITS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) #define BACKUP_SUFFIX ".old" *************** *** 90,96 **** char *flags, *to_name, *group = NULL, *owner = NULL; iflags = 0; ! while ((ch = getopt(argc, argv, "B:bCcDdf:g:m:o:pSs")) != -1) switch(ch) { case 'C': docompare = 1; --- 91,97 ---- char *flags, *to_name, *group = NULL, *owner = NULL; iflags = 0; ! while ((ch = getopt(argc, argv, "B:bCcDdFf:g:m:o:pSs")) != -1) switch(ch) { case 'C': docompare = 1; *************** *** 104,109 **** --- 105,113 ---- case 'c': /* For backwards compatibility. */ break; + case 'F': + iflags |= USEFSYNC; + break; case 'f': flags = optarg; if (strtofflags(&flags, &fset, NULL)) *************** *** 377,382 **** --- 381,388 ---- safecopy ? tempfile :to_name, strerror(errno)); } + if (flags & USEFSYNC) + fsync(to_fd); (void)close(to_fd); if (!devnull) (void)close(from_fd); *************** *** 618,624 **** usage(void) { (void)fprintf(stderr, "\ ! usage: install [-bCcDdpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner]\n source ... target ...\n"); exit(1); /* NOTREACHED */ } --- 624,630 ---- usage(void) { (void)fprintf(stderr, "\ ! usage: install [-bCcDdDpSs] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner]\n source ... target ...\n"); exit(1); /* NOTREACHED */ }