diff -ruN linuxfirmwarekit-orig/dmesg.c linuxfirmwarekit/dmesg.c --- linuxfirmwarekit-orig/dmesg.c 2007-02-05 21:37:48 +0300 +++ linuxfirmwarekit/dmesg.c 2007-02-22 12:24:54 +0300 @@ -35,6 +35,8 @@ GList *boot_dmesg; /* Holds dmesg info, accessed by non-standalone tests */ extern char *current_test; +/* hold number bytes before tests starts */ +int init_buf_sz; /* Obtains dmesg, cleans it up, and adds it to our resource list. @@ -54,7 +56,9 @@ klogctl (6, NULL, 0); memset(dmesg, 0, DMESG_SIZE); - klogctl (4, dmesg, DMESG_SIZE); + /* see manpage (2) for klogctl. 3 - read only, dont cleanup ring buffer */ + /* 4 - read and cleanup adn next time firmwarekit shows incorrect results */ + init_buf_sz = klogctl (3, dmesg, DMESG_SIZE); /* Add to our resource list that we keep. The user * will have access to this when they look at the @@ -294,16 +298,18 @@ assert(dmesg!=NULL); memset(dmesg, 0, DMESG_SIZE); - klogctl (4, dmesg, DMESG_SIZE); + /* see manpage (2) for klogctl. 3 - read only, dont cleanup ring buffer */ + /* 4 - read and cleanup adn next time firmwarekit shows incorrect results */ + klogctl (3, dmesg, DMESG_SIZE); if (current_test) sprintf(buf, "dmesg://%s", current_test); else strcat(buf, "dmesg://"); - announce_resource(buf, dmesg, "dmesg://"); + c1 = dmesg + init_buf_sz; + announce_resource(buf, c1, "dmesg://"); - c1 = dmesg; while (c1) { c2 = strchr(c1, '\n'); if (c2==NULL)