]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: rename strmode() and setmode()
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sun, 7 Feb 2016 11:59:57 +0000 (12:59 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 18 Feb 2016 11:53:48 +0000 (12:53 +0100)
On BSD they are part of the standard C library.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
include/strutils.h
lib/strutils.c
libsmartcols/samples/tree.c
misc-utils/lsblk.c
misc-utils/namei.c
sys-utils/lsipc.c
text-utils/ul.c

index ec2a8acd67594c6498124c0c71d50c11c15e2753..4bb3b2dc35b893c7f56afedeab1ffe9f972d32c1 100644 (file)
@@ -78,7 +78,7 @@ static inline char *strdup_to_offset(void *stru, size_t offset, const char *str)
 #define strdup_to_struct_member(_s, _m, _str) \
                strdup_to_offset((void *) _s, offsetof(__typeof__(*(_s)), _m), _str)
 
-extern void strmode(mode_t mode, char *str);
+extern void xstrmode(mode_t mode, char *str);
 
 /* Options for size_to_human_string() */
 enum
index ac59de8eed46997965b3c1465ba5e1de804a38fe..ef81ebd748281523b6049a5f69c3c69344aad38d 100644 (file)
@@ -425,7 +425,7 @@ void strtotimeval_or_err(const char *str, struct timeval *tv, const char *errmes
  * Converts stat->st_mode to ls(1)-like mode string. The size of "str" must
  * be 11 bytes.
  */
-void strmode(mode_t mode, char *str)
+void xstrmode(mode_t mode, char *str)
 {
        unsigned short i = 0;
 
index 7f41f9eb42644502d7d50d8fc6b6eac5b874bf33..52be7fbd57bbdc73bdff12d438a4160d131f7d66 100644 (file)
@@ -59,7 +59,7 @@ static int add_line_from_stat(struct libscols_table *tb,
                err(EXIT_FAILURE, "failed to create output line");
 
        /* MODE; local buffer, use scols_line_set_data() that calls strdup() */
-       strmode(mode, modbuf);
+       xstrmode(mode, modbuf);
        if (scols_line_set_data(ln, COL_MODE, modbuf))
                goto fail;
 
index 1162d0778915a75a9804583f6a9ef4d6aed37d2b..5c065a90365693507b17a486e9570d8f4674e701 100644 (file)
@@ -911,7 +911,7 @@ static void set_scols_data(struct blkdev_cxt *cxt, int col, int id, struct libsc
                char md[11];
 
                if (!st_rc) {
-                       strmode(cxt->st.st_mode, md);
+                       xstrmode(cxt->st.st_mode, md);
                        str = xstrdup(md);
                }
                break;
index 41557cac304a257750fdc1110d2bc861d7661f45..576e3ef867ddc604f83ada4dbca34c5439a08c52 100644 (file)
@@ -288,7 +288,7 @@ print_namei(struct namei *nm, char *path)
                        return -1;
                }
 
-               strmode(nm->st.st_mode, md);
+               xstrmode(nm->st.st_mode, md);
 
                if (nm->mountpoint)
                        md[0] = 'D';
index 523859c6d2afb1d9c03bef5c317e92dfcba1acad..9e34e6b592543cbcd979323a06908e2629d69e29 100644 (file)
@@ -579,7 +579,7 @@ static void do_sem(int id, struct lsipc_control *ctl, struct libscols_table *tb)
                                        xasprintf(&arg, "%#o", semdsp->sem_perm.mode & 0777);
                                else {
                                        arg = xmalloc(11);
-                                       strmode(semdsp->sem_perm.mode & 0777, arg);
+                                       xstrmode(semdsp->sem_perm.mode & 0777, arg);
                                }
                                rc = scols_line_refer_data(ln, n, arg);
                                break;
@@ -776,7 +776,7 @@ static void do_msg(int id, struct lsipc_control *ctl, struct libscols_table *tb)
                                        xasprintf(&arg, "%#o", msgdsp->msg_perm.mode & 0777);
                                else {
                                        arg = xmalloc(11);
-                                       strmode(msgdsp->msg_perm.mode & 0777, arg);
+                                       xstrmode(msgdsp->msg_perm.mode & 0777, arg);
                                        rc = scols_line_refer_data(ln, n, arg);
                                }
                                break;
@@ -928,7 +928,7 @@ static void do_shm(int id, struct lsipc_control *ctl, struct libscols_table *tb)
                                        xasprintf(&arg, "%#o", shmdsp->shm_perm.mode & 0777);
                                else {
                                        arg = xmalloc(11);
-                                       strmode(shmdsp->shm_perm.mode & 0777, arg);
+                                       xstrmode(shmdsp->shm_perm.mode & 0777, arg);
                                }
                                rc = scols_line_refer_data(ln, n, arg);
                                break;
index 7765b571e660c7c303d8085fe5ac091d683bdbe5..115b882324d35a0991181c465e191556551a3194 100644 (file)
@@ -81,7 +81,7 @@ static void fwd(void);
 static void reverse(void);
 static void initinfo(void);
 static void outc(wint_t c, int width);
-static void setmode(int newmode);
+static void xsetmode(int newmode);
 static void setcol(int newcol);
 static void needcol(int col);
 static void sig_handler(int signo);
@@ -368,7 +368,7 @@ static void flushln(void)
        for (i = 0; i < maxcol; i++) {
                if (obuf[i].c_mode != lastmode) {
                        hadmodes++;
-                       setmode(obuf[i].c_mode);
+                       xsetmode(obuf[i].c_mode);
                        lastmode = obuf[i].c_mode;
                }
                if (obuf[i].c_char == '\0') {
@@ -382,7 +382,7 @@ static void flushln(void)
                        i += obuf[i].c_width - 1;
        }
        if (lastmode != NORMAL) {
-               setmode(0);
+               xsetmode(0);
        }
        if (must_overstrike && hadmodes)
                overstrike();
@@ -560,11 +560,11 @@ static void outc(wint_t c, int width) {
        }
 }
 
-static void setmode(int newmode)
+static void xsetmode(int newmode)
 {
        if (!iflag) {
                if (curmode != NORMAL && newmode != NORMAL)
-                       setmode(NORMAL);
+                       xsetmode(NORMAL);
                switch (newmode) {
                case NORMAL:
                        switch (curmode) {