summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2010-01-08 15:28:16 +0100
committerDavid Sommerseth <davids@redhat.com>2010-01-08 15:28:16 +0100
commitf06734946d5c5fb29a0cd24785101921f78c7756 (patch)
tree7b0aaeade85268f7d2fa6d0e0d894df2a16a8a7f /src/util.c
parent2d12f753c24bcd8fb959e850ea303b0db55e2e9b (diff)
downloadpython-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.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/util.c b/src/util.c
index 014b75d..9bd86c5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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;
-}
-