diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-12-09 10:47:09 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2010-12-09 10:47:09 +0200 |
commit | d92df520790dffbc114cd17c4cd1d45a09c118f9 (patch) | |
tree | ec9072833a950a71782c871cb754fb4d7665d906 /src/apk_blob.h | |
parent | c9690b0e7cdb977184e9649cd1bd3688787c1fb5 (diff) | |
download | apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.tar.gz apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.tar.bz2 apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.tar.xz apk-tools-d92df520790dffbc114cd17c4cd1d45a09c118f9.zip |
io: enhance istream/bstreams with pipe to forked child
* prunes the child pid to avoid zombies
* handles the errors so e.g. file-not-found is reported properly
Diffstat (limited to 'src/apk_blob.h')
-rw-r--r-- | src/apk_blob.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/apk_blob.h b/src/apk_blob.h index 8ef95c6..877635c 100644 --- a/src/apk_blob.h +++ b/src/apk_blob.h @@ -18,7 +18,7 @@ #include "apk_defines.h" struct apk_blob { - unsigned int len; + long len; char *ptr; }; typedef struct apk_blob apk_blob_t; @@ -56,6 +56,7 @@ static inline const EVP_MD *apk_checksum_default(void) #define APK_BLOB_IS_NULL(blob) ((blob).ptr == NULL) #define APK_BLOB_NULL ((apk_blob_t){0, NULL}) +#define APK_BLOB_ERROR(err) ((apk_blob_t){err, NULL}) #define APK_BLOB_BUF(buf) ((apk_blob_t){sizeof(buf), (char *)(buf)}) #define APK_BLOB_CSUM(csum) ((apk_blob_t){(csum).type, (char *)(csum).data}) #define APK_BLOB_STRUCT(s) ((apk_blob_t){sizeof(s), (char*)&(s)}) |