return NULL;
xfp = (XFILE *) xmalloc(sizeof(*xfp));
xfp->x_fp = fp;
- xfp->x_line = 0;
+ xfp->x_line = 1;
return xfp;
}
struct flock fl = { readonly? F_RDLCK : F_WRLCK, SEEK_SET, 0, 0, 0 };
int fd;
- if ((fd = open(fname, readonly? O_RDONLY : O_RDWR)) < 0) {
+ if ((fd = open(fname, readonly? O_RDONLY : (O_RDWR|O_CREAT))) < 0) {
xlog(L_WARNING, "could not open %s for locking", fname);
return -1;
}