From: Ian Jackson Date: Sun, 27 Nov 2016 10:09:49 +0000 (+0000) Subject: regress: Make special arrangements for close() X-Git-Tag: adns-1.6.0~76 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=89ffd9b5cfe4dbe1d7c960e6063900e41832c7b7;p=adns.git regress: Make special arrangements for close() fuzzraw wants to track fds, so we can't just pass to through there. All the other sites get a macro hm_stdsyscall_close to just get the simple version. Signed-off-by: Ian Jackson --- diff --git a/regress/harness.h.m4 b/regress/harness.h.m4 index ca0eeb0..65c0ba6 100644 --- a/regress/harness.h.m4 +++ b/regress/harness.h.m4 @@ -39,6 +39,7 @@ hm_create_proto_q m4_define(`hm_syscall', `void Q$1(hm_args_massage($3,void));') m4_define(`hm_specsyscall', `') m4_include(`hsyscalls.i4') +hm_stdsyscall_close void Q_vb(void); diff --git a/regress/hcommon.c.m4 b/regress/hcommon.c.m4 index ced1612..a20ee17 100644 --- a/regress/hcommon.c.m4 +++ b/regress/hcommon.c.m4 @@ -134,6 +134,8 @@ m4_define(`hm_specsyscall', `') m4_include(`hsyscalls.i4') +hm_stdsyscall_close + void Tvbaddr(const struct sockaddr *addr, int len) { char buf[ADNS_ADDR2TEXT_BUFLEN]; int err, port; diff --git a/regress/hfuzzraw.c.m4 b/regress/hfuzzraw.c.m4 index c575ddb..c9c24ce 100644 --- a/regress/hfuzzraw.c.m4 +++ b/regress/hfuzzraw.c.m4 @@ -246,3 +246,10 @@ m4_define(`hm_specsyscall', `') m4_include(`hsyscalls.i4') +int Hclose(int fd) { + int r; + P_fdf(fd); + fdtab.buf[fd]= 0; + hm_rv_succfail + return r; +} diff --git a/regress/hplayback.c.m4 b/regress/hplayback.c.m4 index 916f97d..547dfe4 100644 --- a/regress/hplayback.c.m4 +++ b/regress/hplayback.c.m4 @@ -397,3 +397,5 @@ int H$1(hm_args_massage($3,void)) { m4_define(`hm_specsyscall', `') m4_include(`hsyscalls.i4') + +hm_stdsyscall_close diff --git a/regress/hrecord.c.m4 b/regress/hrecord.c.m4 index e7e6606..f23df33 100644 --- a/regress/hrecord.c.m4 +++ b/regress/hrecord.c.m4 @@ -156,3 +156,5 @@ int H$1(hm_args_massage($3,void)) { m4_define(`hm_specsyscall', `') m4_include(`hsyscalls.i4') + +hm_stdsyscall_close diff --git a/regress/hsyscalls.i4 b/regress/hsyscalls.i4 index 57270d8..9ad7eb2 100644 --- a/regress/hsyscalls.i4 +++ b/regress/hsyscalls.i4 @@ -100,11 +100,6 @@ hm_syscall( hm_arg_int(backlog) hm_na ') -hm_syscall( - close, `hm_rv_succfail', ` - hm_arg_fd(fd) hm_na -') - hm_syscall( sendto, `hm_rv_any', ` hm_arg_fd(fd) hm_na @@ -136,6 +131,14 @@ hm_syscall( hm_specsyscall(int, writev, `int fd, const struct iovec *vector, size_t count') hm_specsyscall(int, gettimeofday, `struct timeval *tv, struct timezone *tz') hm_specsyscall(pid_t, getpid, `void') +hm_specsyscall(int, close, `int fd') + +m4_define(hm_stdsyscall_close,` +hm_syscall( + close, `hm_rv_succfail', ` + hm_arg_fd(fd) hm_na +') +') hm_specsyscall(void*, malloc, `size_t sz') hm_specsyscall(void, free, `void *ptr')