summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-09 17:17:47 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-10 14:46:59 +0100
commit2d93c20e5f600a9f1e4b617123577acf6ce5faa0 (patch)
tree9c1e17edb84c37920bb37d0fb8021c058c4ca2b3 /src/import
parent71c163c9fa737053bccf8f6d733b272dfacc966f (diff)
downloadsystemd-2d93c20e5f600a9f1e4b617123577acf6ce5faa0.tar.gz
tree-wide: use -EINVAL for enum invalid values
As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-compress.h2
-rw-r--r--src/import/importd.c2
-rw-r--r--src/import/pull-common.h2
-rw-r--r--src/import/pull-job.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/import/import-compress.h b/src/import/import-compress.h
index 3c35b59104..0a4210378a 100644
--- a/src/import/import-compress.h
+++ b/src/import/import-compress.h
@@ -17,7 +17,7 @@ typedef enum ImportCompressType {
IMPORT_COMPRESS_GZIP,
IMPORT_COMPRESS_BZIP2,
_IMPORT_COMPRESS_TYPE_MAX,
- _IMPORT_COMPRESS_TYPE_INVALID = -1,
+ _IMPORT_COMPRESS_TYPE_INVALID = -EINVAL,
} ImportCompressType;
typedef struct ImportCompress {
diff --git a/src/import/importd.c b/src/import/importd.c
index 65fe3701c6..9ac2f8dcfe 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -46,7 +46,7 @@ typedef enum TransferType {
TRANSFER_PULL_TAR,
TRANSFER_PULL_RAW,
_TRANSFER_TYPE_MAX,
- _TRANSFER_TYPE_INVALID = -1,
+ _TRANSFER_TYPE_INVALID = -EINVAL,
} TransferType;
struct Transfer {
diff --git a/src/import/pull-common.h b/src/import/pull-common.h
index d420025fab..3902e29f2b 100644
--- a/src/import/pull-common.h
+++ b/src/import/pull-common.h
@@ -33,7 +33,7 @@ typedef enum VerificationStyle {
VERIFICATION_PER_FILE, /* SuSE-style ".sha256" files with inline gpg signature */
VERIFICATION_PER_DIRECTORY, /* Ubuntu-style SHA256SUM files with detached SHA256SUM.gpg signatures */
_VERIFICATION_STYLE_MAX,
- _VERIFICATION_STYLE_INVALID = -1,
+ _VERIFICATION_STYLE_INVALID = -EINVAL,
} VerificationStyle;
int verification_style_from_url(const char *url, VerificationStyle *style);
diff --git a/src/import/pull-job.h b/src/import/pull-job.h
index 48cc773beb..8e416d51ba 100644
--- a/src/import/pull-job.h
+++ b/src/import/pull-job.h
@@ -22,7 +22,7 @@ typedef enum PullJobState {
PULL_JOB_DONE,
PULL_JOB_FAILED,
_PULL_JOB_STATE_MAX,
- _PULL_JOB_STATE_INVALID = -1,
+ _PULL_JOB_STATE_INVALID = -EINVAL,
} PullJobState;
#define PULL_JOB_IS_COMPLETE(j) (IN_SET((j)->state, PULL_JOB_DONE, PULL_JOB_FAILED))