diff options
author | David Sommerseth <davids@redhat.com> | 2010-01-08 15:28:16 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2010-01-08 15:28:16 +0100 |
commit | f06734946d5c5fb29a0cd24785101921f78c7756 (patch) | |
tree | 7b0aaeade85268f7d2fa6d0e0d894df2a16a8a7f /src/util.c | |
parent | 2d12f753c24bcd8fb959e850ea303b0db55e2e9b (diff) | |
download | python-dmidecode-f06734946d5c5fb29a0cd24785101921f78c7756.tar.gz python-dmidecode-f06734946d5c5fb29a0cd24785101921f78c7756.tar.xz python-dmidecode-f06734946d5c5fb29a0cd24785101921f78c7756.zip |
Moved write_dump() over to dmidump.c, as this is the only user of this function
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 36 |
1 files changed, 0 insertions, 36 deletions
@@ -154,39 +154,3 @@ void *mem_chunk(size_t base, size_t len, const char *devmem) return p; } -int write_dump(size_t base, size_t len, const void *data, const char *dumpfile, int add) -{ - FILE *f; - - f = fopen(dumpfile, add ? "r+b" : "wb"); - if(!f) { - fprintf(stderr, "%s: ", dumpfile); - perror("fopen"); - return -1; - } - - if(fseek(f, base, SEEK_SET) != 0) { - fprintf(stderr, "%s: ", dumpfile); - perror("fseek"); - goto err_close; - } - - if(fwrite(data, len, 1, f) != 1) { - fprintf(stderr, "%s: ", dumpfile); - perror("fwrite"); - goto err_close; - } - - if(fclose(f)) { - fprintf(stderr, "%s: ", dumpfile); - perror("fclose"); - return -1; - } - - return 0; - - err_close: - fclose(f); - return -1; -} - |