Skip to content

Commit 13444ac

Browse files
committed
don't try to open protect_file when dry_run=1, blocks testing as !root
1 parent 4763fa5 commit 13444ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hdapsd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ int main (int argc, char** argv)
841841
/* check the protect attribute exists */
842842
/* wait for it if it's not there (in case the attribute hasn't been created yet) */
843843
p = disklist;
844-
while (p != NULL) {
844+
while (p != NULL && !dry_run) {
845845
fd = open (p->protect_file, O_RDWR);
846846
if (background)
847847
for (i = 0; fd < 0 && i < 100; ++i) {

0 commit comments

Comments
 (0)