Provide errno from rumpuser_{gettimeofday,close}() to be consistent.
This commit is contained in:
parent
8747215ce0
commit
ccd777c8fa
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: emul.c,v 1.11 2007/08/26 23:51:08 pooka Exp $ */
|
||||
/* $NetBSD: emul.c,v 1.12 2007/09/10 19:11:44 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -212,8 +212,9 @@ device_class(device_t dev)
|
|||
void
|
||||
getmicrouptime(struct timeval *tvp)
|
||||
{
|
||||
int error;
|
||||
|
||||
rumpuser_gettimeofday(tvp);
|
||||
rumpuser_gettimeofday(tvp, &error);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -261,8 +262,9 @@ void
|
|||
nanotime(struct timespec *ts)
|
||||
{
|
||||
struct timeval tv;
|
||||
int error;
|
||||
|
||||
rumpuser_gettimeofday(&tv);
|
||||
rumpuser_gettimeofday(&tv, &error);
|
||||
TIMEVAL_TO_TIMESPEC(&tv, ts);
|
||||
}
|
||||
|
||||
|
@ -277,15 +279,17 @@ getnanotime(struct timespec *ts)
|
|||
void
|
||||
microtime(struct timeval *tv)
|
||||
{
|
||||
int error;
|
||||
|
||||
rumpuser_gettimeofday(tv);
|
||||
rumpuser_gettimeofday(tv, &error);
|
||||
}
|
||||
|
||||
void
|
||||
getmicrotime(struct timeval *tv)
|
||||
{
|
||||
int error;
|
||||
|
||||
rumpuser_gettimeofday(tv);
|
||||
rumpuser_gettimeofday(tv, &error);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: specfs.c,v 1.6 2007/08/20 15:58:14 pooka Exp $ */
|
||||
/* $NetBSD: specfs.c,v 1.7 2007/09/10 19:11:44 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -89,7 +89,9 @@ rump_specopen(void *v)
|
|||
memset(&sp->rsp_dl, 0, sizeof(sp->rsp_dl));
|
||||
|
||||
if (rumpuser_stat(sp->rsp_path, &sb, &error) == -1) {
|
||||
rumpuser_close(fd);
|
||||
int dummy;
|
||||
|
||||
rumpuser_close(fd, &dummy);
|
||||
return error;
|
||||
}
|
||||
sp->rsp_pi.p_size = sb.st_size >> DEV_BSHIFT;
|
||||
|
@ -145,8 +147,9 @@ rump_specclose(void *v)
|
|||
} */ *ap = v;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct rump_specpriv *sp = vp->v_data;
|
||||
int error;
|
||||
|
||||
rumpuser_close(sp->rsp_fd);
|
||||
rumpuser_close(sp->rsp_fd, &error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.c,v 1.6 2007/08/20 15:58:14 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.c,v 1.7 2007/09/10 19:11:45 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -138,11 +138,11 @@ rumpuser_ioctl(int fd, u_long cmd, void *data, int *error)
|
|||
DOCALL(int, (ioctl(fd, cmd, data)));
|
||||
}
|
||||
|
||||
void
|
||||
rumpuser_close(int fd)
|
||||
int
|
||||
rumpuser_close(int fd, int *error)
|
||||
{
|
||||
|
||||
close(fd);
|
||||
DOCALL(int, close(fd));
|
||||
}
|
||||
|
||||
ssize_t
|
||||
|
@ -160,10 +160,10 @@ rumpuser_pwrite(int fd, const void *data, size_t size, off_t offset, int *error)
|
|||
}
|
||||
|
||||
int
|
||||
rumpuser_gettimeofday(struct timeval *tv)
|
||||
rumpuser_gettimeofday(struct timeval *tv, int *error)
|
||||
{
|
||||
|
||||
return gettimeofday(tv, NULL);
|
||||
DOCALL(int, gettimeofday(tv, NULL));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rumpuser.h,v 1.4 2007/08/20 15:58:14 pooka Exp $ */
|
||||
/* $NetBSD: rumpuser.h,v 1.5 2007/09/10 19:11:45 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -45,12 +45,12 @@ void rumpuser_free(void *);
|
|||
|
||||
int rumpuser_open(const char *, int, int *);
|
||||
int rumpuser_ioctl(int, u_long, void *, int *);
|
||||
void rumpuser_close(int);
|
||||
int rumpuser_close(int, int *);
|
||||
|
||||
ssize_t rumpuser_pread(int, void *, size_t, off_t, int *);
|
||||
ssize_t rumpuser_pwrite(int, const void *, size_t, off_t, int *);
|
||||
|
||||
int rumpuser_gettimeofday(struct timeval *);
|
||||
int rumpuser_gettimeofday(struct timeval *, int *);
|
||||
|
||||
uint16_t rumpuser_bswap16(uint16_t);
|
||||
uint32_t rumpuser_bswap32(uint32_t);
|
||||
|
|
Loading…
Reference in New Issue