Skip to content

Commit b67f05d

Browse files
poetteringyuwata
authored andcommitted
fsck: split out fsck return code definitions into a header file of its own
This way we can make use of it from other components too, such as systemd-homed.
1 parent a709a31 commit b67f05d

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

src/fsck/fsck.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "device-util.h"
2323
#include "fd-util.h"
2424
#include "fs-util.h"
25+
#include "fsck-util.h"
2526
#include "main-func.h"
2627
#include "parse-util.h"
2728
#include "path-util.h"
@@ -34,18 +35,6 @@
3435
#include "stdio-util.h"
3536
#include "util.h"
3637

37-
/* exit codes as defined in fsck(8) */
38-
enum {
39-
FSCK_SUCCESS = 0,
40-
FSCK_ERROR_CORRECTED = 1 << 0,
41-
FSCK_SYSTEM_SHOULD_REBOOT = 1 << 1,
42-
FSCK_ERRORS_LEFT_UNCORRECTED = 1 << 2,
43-
FSCK_OPERATIONAL_ERROR = 1 << 3,
44-
FSCK_USAGE_OR_SYNTAX_ERROR = 1 << 4,
45-
FSCK_USER_CANCELLED = 1 << 5,
46-
FSCK_SHARED_LIB_ERROR = 1 << 7,
47-
};
48-
4938
static bool arg_skip = false;
5039
static bool arg_force = false;
5140
static bool arg_show_progress = false;

src/shared/fsck-util.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* SPDX-License-Identifier: LGPL-2.1+ */
2+
#pragma once
3+
4+
/* exit codes as defined in fsck(8) */
5+
enum {
6+
FSCK_SUCCESS = 0,
7+
FSCK_ERROR_CORRECTED = 1 << 0,
8+
FSCK_SYSTEM_SHOULD_REBOOT = 1 << 1,
9+
FSCK_ERRORS_LEFT_UNCORRECTED = 1 << 2,
10+
FSCK_OPERATIONAL_ERROR = 1 << 3,
11+
FSCK_USAGE_OR_SYNTAX_ERROR = 1 << 4,
12+
FSCK_USER_CANCELLED = 1 << 5,
13+
FSCK_SHARED_LIB_ERROR = 1 << 7,
14+
};

src/shared/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ shared_sources = files('''
7474
firewall-util.h
7575
format-table.c
7676
format-table.h
77+
fsck-util.h
7778
fstab-util.c
7879
fstab-util.h
7980
generator.c

0 commit comments

Comments
 (0)