diff options
| author | Michael Forney <mforney@mforney.org> | 2021-06-05 15:15:49 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2021-06-06 03:04:01 -0700 |
| commit | 57dd586471765d2dcc81502dd7bfcc6aeab9a462 (patch) | |
| tree | 889289966af27d4f8d0732955c19338872c84bfa /pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch | |
| parent | 1b27f8dcb19280253141120e12f69ed2a17539ea (diff) | |
util-linux: Update to 2.37
Diffstat (limited to 'pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch')
| -rw-r--r-- | pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch b/pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch index 1f13553f..6674de25 100644 --- a/pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch +++ b/pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch @@ -1,23 +1,24 @@ -From 922e927710ecc196aa6f60eab1690a113c2a96ee Mon Sep 17 00:00:00 2001 +From 2cfdfe606f814c7672baede286c904c051b00e99 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Tue, 12 Mar 2019 17:13:45 -0700 Subject: [PATCH] Avoid statement expressions min/max --- include/c.h | 24 ++++++++++-------------- + include/strutils.h | 3 ++- lib/mbsalign.c | 2 +- libfdisk/src/alignment.c | 8 ++++---- libfdisk/src/context.c | 4 ++-- libfdisk/src/gpt.c | 4 ++-- libsmartcols/src/calculate.c | 8 ++++---- libsmartcols/src/column.c | 2 +- - 7 files changed, 24 insertions(+), 28 deletions(-) + 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/include/c.h b/include/c.h -index 66fefe2a2..d7eeb699e 100644 +index b420b5187..fe82a8847 100644 --- a/include/c.h +++ b/include/c.h -@@ -126,21 +126,17 @@ +@@ -141,21 +141,17 @@ # define FALSE 0 #endif @@ -49,6 +50,20 @@ index 66fefe2a2..d7eeb699e 100644 #ifndef cmp_numbers # define cmp_numbers(x, y) __extension__ ({ \ +diff --git a/include/strutils.h b/include/strutils.h +index 7969a84d0..45c1768f0 100644 +--- a/include/strutils.h ++++ b/include/strutils.h +@@ -70,7 +70,8 @@ static inline void xstrncpy(char *dest, const char *src, size_t n) + + if (!len) + return; +- len = min(len, n - 1); ++ if (n - 1 < len) ++ len = n - 1; + memcpy(dest, src, len); + dest[len] = 0; + } diff --git a/lib/mbsalign.c b/lib/mbsalign.c index e251202af..f3ea1a2df 100644 --- a/lib/mbsalign.c @@ -63,7 +78,7 @@ index e251202af..f3ea1a2df 100644 } #ifdef HAVE_WIDECHAR diff --git a/libfdisk/src/alignment.c b/libfdisk/src/alignment.c -index 3d0254634..91f6d1f7d 100644 +index 3ae721913..a1a05f48a 100644 --- a/libfdisk/src/alignment.c +++ b/libfdisk/src/alignment.c @@ -38,7 +38,7 @@ @@ -103,10 +118,10 @@ index 3d0254634..91f6d1f7d 100644 cxt->grain = cxt->user_grain < granularity ? granularity : cxt->user_grain; DBG(CXT, ul_debugobj(cxt, "new grain: %lu", cxt->grain)); diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c -index 206627849..6c3a17b98 100644 +index 083b255d3..a3bfff993 100644 --- a/libfdisk/src/context.c +++ b/libfdisk/src/context.c -@@ -894,7 +894,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org) +@@ -919,7 +919,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org) /* the current layout */ fdisk_get_partitions(cxt, &tb); /* maximal number of partitions */ @@ -115,7 +130,7 @@ index 206627849..6c3a17b98 100644 while (fdisk_diff_tables(org, tb, &itr, &pa, &change) == 0) { if (change == FDISK_DIFF_UNCHANGED) -@@ -951,7 +951,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org) +@@ -976,7 +976,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org) /* Let's follow the Linux kernel and reduce * DOS extended partition to 1 or 2 sectors. */ @@ -125,7 +140,7 @@ index 206627849..6c3a17b98 100644 if (partx_add_partition(cxt->dev_fd, pa->partno + 1, pa->start * ssf, sz) != 0) { diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c -index 29fcffa59..5e95b205d 100644 +index 5fd9b4d73..97e23767d 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -504,7 +504,7 @@ static int gpt_mknew_pmbr(struct fdisk_context *cxt) @@ -137,7 +152,7 @@ index 29fcffa59..5e95b205d 100644 return 0; } -@@ -931,7 +931,7 @@ static int valid_pmbr(struct fdisk_context *cxt) +@@ -956,7 +956,7 @@ static int valid_pmbr(struct fdisk_context *cxt) /* Note that gpt_write_pmbr() overwrites PMBR, but we want to keep it valid already * in memory too to disable warnings when valid_pmbr() called next time */ pmbr->partition_record[part].size_in_lba = @@ -147,7 +162,7 @@ index 29fcffa59..5e95b205d 100644 } } diff --git a/libsmartcols/src/calculate.c b/libsmartcols/src/calculate.c -index b6137fd23..ed6e8dd25 100644 +index 974fc340c..0c11627a7 100644 --- a/libsmartcols/src/calculate.c +++ b/libsmartcols/src/calculate.c @@ -57,7 +57,7 @@ static int count_cell_width(struct libscols_table *tb, @@ -195,5 +210,5 @@ index c11df69f5..1285d42e6 100644 } -- -2.29.2 +2.31.1 |
