diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-23 08:55:26 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-23 08:55:26 +0200 |
commit | a0b737ad35ca546f8ae14442a39e48d43daf4292 (patch) | |
tree | bc3b8757901f9583bac9fe21d5a48a6faebc28fe /sys/src | |
parent | 4fdc7dbe9c1c6530cf30e367a3db9c8ce0d14a57 (diff) |
create bio file (/adm/keys.who) if it doesnt exist
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/cmd/auth/lib/wrbio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/cmd/auth/lib/wrbio.c b/sys/src/cmd/auth/lib/wrbio.c index e50ca500b..9c688dbe1 100644 --- a/sys/src/cmd/auth/lib/wrbio.c +++ b/sys/src/cmd/auth/lib/wrbio.c @@ -11,8 +11,11 @@ wrbio(char *file, Acctbio *a) int i, fd, n; fd = open(file, OWRITE); - if(fd < 0) - error("can't open %s", file); + if(fd < 0){ + fd = create(file, OWRITE, 0660); + if(fd < 0) + error("can't create %s", file); + } if(seek(fd, 0, 2) < 0) error("can't seek %s", file); |