tree-wide: Fix, replace assert() by assert_se() when there is side effect
authorBenjamin Robin <dev@benjarobin.fr>
Wed, 6 May 2020 18:30:43 +0000 (20:30 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 30 May 2020 18:24:37 +0000 (20:24 +0200)
(cherry picked from commit f391597c6712ad90db37fe4a79047a45f4aca86a)

src/import/import-fs.c
src/partition/repart.c

index 468303a6dce70773752467be2c3df405dbdb80d7..5e61049ced8fe06d6560c3dc5f4447b6de06d326 100644 (file)
@@ -172,8 +172,8 @@ static int import_fs(int argc, char *argv[], void *userdata) {
         progress.limit = (RateLimit) { 200*USEC_PER_MSEC, 1 };
 
         /* Hook into SIGINT/SIGTERM, so that we can cancel things then */
-        assert(sigaction(SIGINT, &sa, &old_sigint_sa) >= 0);
-        assert(sigaction(SIGTERM, &sa, &old_sigterm_sa) >= 0);
+        assert_se(sigaction(SIGINT, &sa, &old_sigint_sa) >= 0);
+        assert_se(sigaction(SIGTERM, &sa, &old_sigterm_sa) >= 0);
 
         r = btrfs_subvol_snapshot_fd_full(
                         fd,
index fcc634f220fd8bd0e2514d16a23100d832680563..b7b1a0a6f31689f0b8c66e22a0b8c3203df45625 100644 (file)
@@ -1722,7 +1722,7 @@ static int context_dump_partition_bar(Context *context, const char *node) {
         bool z = false;
         size_t c, j = 0;
 
-        assert((c = columns()) >= 2);
+        assert_se((c = columns()) >= 2);
         c -= 2; /* We do not use the leftmost and rightmost character cell */
 
         bar = new0(Partition*, c);