From a0b737ad35ca546f8ae14442a39e48d43daf4292 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 23 Oct 2012 08:55:26 +0200 Subject: create bio file (/adm/keys.who) if it doesnt exist --- sys/src/cmd/auth/lib/wrbio.c | 7 +++++-- 1 file 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); -- cgit v1.2.3