[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#337522: anna: goes into ghost lowmem mode 7



Added some debugging in utils.c:
@@ -4,12 +4,15 @@
 int get_lowmem_level (void) {
        int l;
        l=open(LOWMEM_STATUS_FILE, O_RDONLY);
+       di_log (DI_LOG_LEVEL_DEBUG, "lowmem: filehandle %d", l);
        if (l) {
                char buf[2];
                read(l, buf, 1);
                close(l);
+               di_log (DI_LOG_LEVEL_DEBUG, "lowmem: return file %d", atoi(buf));
                return atoi(buf);
        }
+       di_log (DI_LOG_LEVEL_DEBUG, "lowmem: return default 0");
        return 0;
 }

This results in the following in the log:
main-menu[316]: DEBUG: configure anna, status: 2
anna[1366]: DEBUG: lowmem: filehandle -1
anna[1366]: DEBUG: lowmem: return file 0
anna[1366]: DEBUG: lowmem: filehandle -1
anna[1366]: DEBUG: lowmem: return file 6
anna[1366]: DEBUG: install hw-detect, enhances installed packages hw-detect
anna[1366]: DEBUG: lowmem: 6, debconf status: true

So:
- The open statement returns -1 if /var/lib/lowmem file is not present
- In the if -1 evaluates to true.
- The rest is random garbage.
- Why is get_lowmem_level called twice?

Attachment: pgpAs0dMv1gpk.pgp
Description: PGP signature


Reply to: