chiark / gitweb /
Assume that /proc/meminfo can be missing
[elogind.git] / src / test / test-fileio.c
index 4a4ed79..3511f3a 100644 (file)
@@ -232,12 +232,16 @@ static void test_executable_is_script(void) {
 static void test_status_field(void) {
         _cleanup_free_ char *t = NULL, *p = NULL, *s = NULL;
         unsigned long long total, buffers;
+        int r;
 
         assert_se(get_status_field("/proc/self/status", "\nThreads:", &t) == 0);
         puts(t);
         assert_se(streq(t, "1"));
 
-        assert_se(get_status_field("/proc/meminfo", "MemTotal:", &p) == 0);
+        r = get_status_field("/proc/meminfo", "MemTotal:", &p);
+        if (r == -ENOENT)
+                return;
+        assert(r == 0);
         puts(p);
         assert_se(safe_atollu(p, &total) == 0);