Xinqi Bao's Git

Change to fmt_human in netspeeds on OpenBSD
[slstatus.git] / components / entropy.c
index 2baa8aa..606bfec 100644 (file)
@@ -9,10 +9,18 @@
        {
                int num;
 
-               return (pscanf("/proc/sys/kernel/random/entropy_avail",
-                              "%d", &num) == 1) ?
-                      bprintf("%d", num) : NULL;
+               if (pscanf("/proc/sys/kernel/random/entropy_avail",
+                          "%d", &num) != 1) {
+                       return NULL;
+               }
+
+               return bprintf("%d", num);
        }
 #elif defined(__OpenBSD__)
-       /* unimplemented */
+       const char *
+       entropy(void)
+       {
+               /* Unicode Character 'INFINITY' (U+221E) */
+               return "\xe2\x88\x9e";
+       }
 #endif