Last active
September 1, 2016 14:01
-
-
Save ramcq/86a0d7c3521b89d749c0fcd6528592ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static gboolean | |
check_for_live_boot () | |
{ | |
GError *error = NULL; | |
gchar *cmdline = NULL; | |
gboolean live_boot = FALSE; | |
if (g_file_get_contents ("/proc/cmdline", &cmdline, NULL, &error)) | |
{ | |
g_printerr ("unable to read /proc/cmdline: %s\n", error->message); | |
g_error_free (error); | |
return; | |
} | |
live_boot = g_regex_match_simple ("\\bendless\\.live_boot\\b", cmdline, 0, 0); | |
g_print ("set live_boot to %u from /proc/cmdline: %s\n", live_boot, cmdline); | |
g_free (cmdline); | |
return live_boot; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment