Skip to content

Commit a416aa0

Browse files
author
logwang
committed
FreeBSD misc: add a macro to turn on NETGRAPH option and return error when call sleep
1 parent c36e692 commit a416aa0

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

lib/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ VPATH+= $S/crypto/rijndael
109109
VPATH+= $S/crypto/sha2
110110
VPATH+= $S/crypto/siphash
111111
VPATH+= $S/net
112+
ifdef FF_NETGRAPH
112113
VPATH+= $S/netgraph
114+
endif
113115
VPATH+= $S/netinet
114116
VPATH+= $S/netinet/libalias
115117
VPATH+= $S/netinet/cc
@@ -266,6 +268,7 @@ NET_SRCS+= \
266268
rtsock.c \
267269
slcompress.c
268270

271+
ifdef FF_NETGRAPH
269272
NETGRAPH_SRCS += \
270273
ng_async.c \
271274
ng_atmllc.c \
@@ -311,6 +314,7 @@ NETGRAPH_SRCS += \
311314
ng_UI.c \
312315
ng_vjc.c \
313316
ng_vlan.c
317+
endif
314318

315319
NETINET_SRCS+= \
316320
if_ether.c \

lib/ff_glue.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ foffset_lock(struct file *fp, int flags)
10961096
*/
10971097
mtxp = mtx_pool_find(mtxpool_sleep, fp);
10981098
mtx_lock(mtxp);
1099+
/*
10991100
if ((flags & FOF_NOLOCK) == 0) {
11001101
while (fp->f_vnread_flags & FOFFSET_LOCKED) {
11011102
fp->f_vnread_flags |= FOFFSET_LOCK_WAITING;
@@ -1104,6 +1105,7 @@ foffset_lock(struct file *fp, int flags)
11041105
}
11051106
fp->f_vnread_flags |= FOFFSET_LOCKED;
11061107
}
1108+
*/
11071109
res = fp->f_offset;
11081110
mtx_unlock(mtxp);
11091111
return (res);

lib/ff_kern_synch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ _sleep(void *ident, struct lock_object *lock, int priority,
8888
const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
8989
{
9090
//FIXME:we couldn't really sleep.
91-
return (0);
91+
return (EPERM);
9292
}
9393

9494

0 commit comments

Comments
 (0)