Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/netpgpkeys create the ho...
details: https://anonhg.NetBSD.org/src/rev/267e9e1aa019
branches: trunk
changeset: 754670:267e9e1aa019
user: agc <agc%NetBSD.org@localhost>
date: Sat May 08 04:16:20 2010 +0000
description:
create the home directory, if it doesn't exist, in a slightly less opaque manner
diffstat:
crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (16 lines):
diff -r 1d8b829a6240 -r 267e9e1aa019 crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c
--- a/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c Sat May 08 03:00:10 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.c Sat May 08 04:16:20 2010 +0000
@@ -303,8 +303,10 @@
}
/* initialise, and read keys from file */
if (!netpgp_init(&netpgp)) {
- if (stat(netpgp_getvar(&netpgp, "homedir"), &st) < 0 &&
- mkdir("homedir", 0700) < 0) {
+ if (stat(netpgp_getvar(&netpgp, "homedir"), &st) < 0) {
+ (void) mkdir(netpgp_getvar(&netpgp, "homedir"), 0700);
+ }
+ if (stat(netpgp_getvar(&netpgp, "homedir"), &st) < 0) {
(void) fprintf(stderr, "can't create home directory '%s'\n",
netpgp_getvar(&netpgp, "homedir"));
exit(EXIT_ERROR);
Home |
Main Index |
Thread Index |
Old Index