]> granicus.if.org Git - procps-ng/commitdiff
neaten up some code
authoralbert <>
Tue, 20 Jul 2004 22:51:22 +0000 (22:51 +0000)
committeralbert <>
Tue, 20 Jul 2004 22:51:22 +0000 (22:51 +0000)
proc/module.mk
proc/pwcache.c
sysctl.conf

index 929ea2af883bff7fb71bac75c3eff0fc64f23b3a..97ad99d7059bd5aaf3ce503b747df4cf4b283a93 100644 (file)
@@ -74,7 +74,7 @@ DIRS  += proc/
 proc/$(ANAME): $(LIBOBJ)
        $(AR) rcs $@ $^
 
-#proc/$(SONAME): proc/library.map
+proc/$(SONAME): proc/library.map
 proc/$(SONAME): $(LIBOBJ)
        $(CC) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $^ -lc
 
index 19b64c01022ebd98d123266d44cd990878ecfe98..e853dcc2e7dfcd4a111d00b6253d8dd2c84dde6b 100644 (file)
@@ -42,8 +42,9 @@ char *user_from_uid(uid_t uid)
     }
     *p = (struct pwbuf *) xmalloc(sizeof(struct pwbuf));
     (*p)->uid = uid;
-    if ((pw = getpwuid(uid)) == NULL)
-       sprintf((*p)->name, "#%d", uid);
+    pw = getpwuid(uid);
+    if (!pw)
+       sprintf((*p)->name, "%d", uid);
     else
        sprintf((*p)->name, "%-." NAMELENGTH "s", pw->pw_name);
     (*p)->next = NULL;
@@ -69,8 +70,9 @@ char *group_from_gid(gid_t gid)
     }
     *g = (struct grpbuf *) malloc(sizeof(struct grpbuf));
     (*g)->gid = gid;
-    if ((gr = getgrgid(gid)) == NULL)
-       sprintf((*g)->name, "#%d", gid);
+    gr = getgrgid(gid);
+    if (!gr)
+       sprintf((*g)->name, "%d", gid);
     else
        sprintf((*g)->name, "%-." NAMELENGTH "s", gr->gr_name);
     (*g)->next = NULL;
index 9cb38d4a21d09516be01bffbf4923cbe78c85649..6458610024c32b9ab800f15099961ffbc4b4d1fe 100644 (file)
@@ -10,9 +10,12 @@ net/ipv4/conf/all/accept_redirects=0
 net/ipv4/conf/all/accept_source_route=0
 net/ipv4/icmp_echo_ignore_broadcasts =1
 #net/ipv4/ip_forward=1
-#net.ipv4.tcp_ecn = 0
 #net.ipv4.ip_local_port_range = 32768    61000
 
+# Broken routers will corrupt the window scaling and ECN
+#net.ipv4.tcp_default_win_scale = 0
+#net.ipv4.tcp_ecn = 0
+
 #vm.vfs_cache_pressure = 100
 #vm.laptop_mode = 0
 #vm.swappiness = 60