~ubuntu-branches/ubuntu/precise/fnfx/precise

« back to all changes in this revision

Viewing changes to src/fnfx_cfg.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-01-29 11:10:28 UTC
  • mfrom: (1.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20070129111028-yzvfgzbyqaxl55ok
Tags: 0.3-12ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - Add call to autoreconf in rules
  - etc/fnfxd.conf: Changed Hoary to Ubuntu in options that are 
    commented out.
  - Add libtool to Build-Depends
* Add autoconf and automake1.9 to the Build-Depends.
* Stop setting fnkey_descr in src/fnfxd_newacpi.c, s_acpi_cfg doesn't define
  that member.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    if ((daemon_cfg->keymap.fnkey[i].state & FNKEY_ENABLED) &&
75
75
        strlen(daemon_cfg->keymap.fnkey[i].client_command)) {
76
76
        if (daemon_cfg->keymap.fnkey[i].state & FNKEY_EXTERNAL) {
77
 
            char command[CMD_SIZE];
78
 
            sprintf(command, "%s%1c",
 
77
            char command[CMD_SIZE+2];
 
78
            snprintf(command, CMD_SIZE+1, "%s%1c",
79
79
                    daemon_cfg->keymap.fnkey[i].client_command, '&');
80
80
 
81
81
            debug("handle_fnkey() - executing: %s", command);
177
177
        if (!strncmp(line, "action(", 7)) {
178
178
            sscanf(line, "action(key=\"%[^\"]\";command=\"%[^\"]\")",
179
179
                   fnkey_descr, command);
180
 
 
181
180
            if ((strlen(fnkey_descr)) && (strlen(command))) {
182
181
                for (i = 0; i < daemon_cfg->keymap.entries; i++) {
183
182
                    if (!
229
228
            if (!strncmp(line, "[actions]", 8))
230
229
                load_actions(f, line);
231
230
        }
232
 
 
233
231
    }
234
232
    else {
235
233
        fatal
282
280
                    daemon_cfg->keymap.fnkey[i].state = 0;
283
281
                }
284
282
            }
285
 
            if (!(daemon_cfg->acpi.config & VAL_SLEEP)) {
 
283
            if (!(daemon_cfg->acpi.config & VAL_SLEEP) && !(daemon_cfg->acpi.config & VAL_STATE)) {
286
284
                if ((!
287
285
                     (strcmp
288
286
                      (daemon_cfg->keymap.fnkey[i].client_command,
292
290
                        "suspend to disk")))
293
291
                    ) {
294
292
                    debug
295
 
                        ("error (non-fatal): The command \"%s\" is used for %s, but \"%s\" is not available. "
 
293
                        ("error (non-fatal): The command \"%s\" is used for %s, but \"%s\" or \"%s\" is not available. "
296
294
                         "Disabling defined action.",
297
295
                         daemon_cfg->keymap.fnkey[i].client_command,
298
 
                         daemon_cfg->keymap.fnkey[i].descr, ACPI_SLEEP);
 
296
                         daemon_cfg->keymap.fnkey[i].descr, ACPI_SLEEP, ACPI_STATE);
299
297
                    strcpy(daemon_cfg->keymap.fnkey[i].client_command, "");
300
298
                    daemon_cfg->keymap.fnkey[i].state = 0;
301
299