Message ID | 20130422223114.GD25389@lenny.home.zabbo.net (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
--- test.c.busted 2013-04-22 15:22:57.593575545 -0700 +++ test.c 2013-04-22 15:29:25.358072087 -0700 @@ -7,7 +7,7 @@ static void drop_all_caches() { - int value = 3; + char value[] = "3\n"; int fd; if ((fd = open("/proc/sys/vm/drop_caches", O_WRONLY)) < 0) { @@ -15,7 +15,7 @@ return; } - write(fd, &value, sizeof(int)); + write(fd, value, sizeof(value) - 1); close(fd); }