Page MenuHomeFreeBSD

D4683.id11606.diff
No OneTemporary

D4683.id11606.diff

Index: sys/kern/kern_resource.c
===================================================================
--- sys/kern/kern_resource.c
+++ sys/kern/kern_resource.c
@@ -80,8 +80,6 @@
static struct uidinfo *uilookup(uid_t uid);
static void ruxagg_locked(struct rusage_ext *rux, struct thread *td);
-static __inline int lim_shared(struct plimit *limp);
-
/*
* Resource controls and accounting.
*/
@@ -1109,6 +1107,8 @@
return (limp);
}
+/* Fix -Wunused warning with clang by only exposing lim_shared with INVARIANTS. */
+#ifdef INVARIANTS
static __inline int
lim_shared(struct plimit *limp)
{
@@ -1115,6 +1115,7 @@
return (limp->pl_refcnt > 1);
}
+#endif
void
lim_fork(struct proc *p1, struct proc *p2)
@@ -1146,7 +1147,9 @@
lim_copy(struct plimit *dst, struct plimit *src)
{
+#ifdef INVARIANTS
KASSERT(!lim_shared(dst), ("lim_copy to shared limit"));
+#endif
bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit));
}

File Metadata

Mime Type
text/plain
Expires
Thu, Aug 27, 3:47 AM (13 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37348637
Default Alt Text
D4683.id11606.diff (953 B)

Event Timeline