diff options
author | pancake <pancake@dazo> | 2008-12-08 00:21:05 +0100 |
---|---|---|
committer | pancake <pancake@dazo> | 2008-12-08 00:21:05 +0100 |
commit | 3d427bfd7740731bfc203b047d557af564975cf6 (patch) | |
tree | ffef9e82ba45e75d03679aed04b4086d57d6bba7 /src/qmode.c | |
parent | edac98d26ee29bbdc3e16be8ecec5cbfff80482f (diff) | |
download | 0xFFFF-3d427bfd7740731bfc203b047d557af564975cf6.tar.bz2 |
* Added -n flag to do not write to disk or flash (simulation)
* Added -S flag to specify subversion id manually while flashing or dumping
* Fixed support for the last fiasco image
- Skip paddings
- More verbose output while parsing FIASCO headers
* Initial implementation of the full direct FIASCO flasher
- No need to dump manually before flashing
* Some warnings and code cleanup
* Fix building issue
* Add HAVE_GUI directive in config.mk
* Up to version 0.4
Diffstat (limited to 'src/qmode.c')
-rw-r--r-- | src/qmode.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/qmode.c b/src/qmode.c index 3aa73fa..5bfa765 100644 --- a/src/qmode.c +++ b/src/qmode.c @@ -19,7 +19,13 @@ #include "main.h" #include "os.h" #include <stdio.h> +#include <string.h> +#include <stdlib.h> #include <signal.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <sys/stat.h> + #if HAVE_SQUEUE struct squeue_t *q; @@ -43,23 +49,19 @@ void process_message(char *msg) printf("[x] (%s)\n", msg); str = strdup(msg); arg = strchr(str, ':'); - if (c!=NULL) { + if (c!=0) { arg[0]='\0'; arg = arg +1; if (!strcmp(str, "flash")) { - char buf[1024]; - char *type = fpid_file(arg); + const char *type = fpid_file(arg); if (type == NULL) { squeue_push2(p, "error", "Unknown piece format", 1); - } else { - flash_image(arg, type, NULL); - } + } else flash_image(arg, type, NULL); } else if (!strcmp(str, "reset")) { if (reboot_board() == 0) { squeue_push2(p,"info", "Device reboots", 1); - } else - squeue_push2(p,"error", "Cannot reboot device", 1); + } else squeue_push2(p,"error", "Cannot reboot device", 1); } else if (!strcmp(str, "info")) { get_rd_flags(); @@ -95,7 +97,7 @@ int queue_mode() pid = dofork(); if (pid) { - wait(pid); + wait(&pid); return 0; } else { p = squeue_open("/tmp/0xFFFF.1", Q_CREAT); |