[wiki] [sites] [dwm][patch][statuscmd] Ignore pclose return value || Daniel Bylinka

From: <git_AT_suckless.org>
Date: Tue, 06 Apr 2021 23:36:25 +0200

commit 1f20d8cefb96cdf64300ddb9168a2e2b6c273743
Author: Daniel Bylinka <daniel.bylinka_AT_gmail.com>
Date: Tue Apr 6 23:33:37 2021 +0200

    [dwm][patch][statuscmd] Ignore pclose return value

diff --git a/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-20210402-67d76bd.diff b/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-20210405-67d76bd.diff
similarity index 92%
rename from dwm.suckless.org/patches/statuscmd/dwm-statuscmd-20210402-67d76bd.diff
rename to dwm.suckless.org/patches/statuscmd/dwm-statuscmd-20210405-67d76bd.diff
index 21c7a2d6..4b264201 100644
--- a/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-20210402-67d76bd.diff
+++ b/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-20210405-67d76bd.diff
_AT_@ -1,13 +1,13 @@
-From bac80422bffa972ea300b52f51436f772188cbbd Mon Sep 17 00:00:00 2001
+From f58c7e4fd05ec13383518ccd51663167d45e92d0 Mon Sep 17 00:00:00 2001
 From: Daniel Bylinka <daniel.bylinka_AT_gmail.com>
 Date: Fri, 2 Apr 2021 19:02:58 +0200
 Subject: [PATCH] [statuscmd] Signal mouse button and click location to status
  monitor
 
 ---
- config.def.h | 6 +++-
- dwm.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++---
- 2 files changed, 99 insertions(+), 6 deletions(-)
+ config.def.h | 6 +++-
+ dwm.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ 2 files changed, 100 insertions(+), 6 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index 1c0b587..154a59b 100644
_AT_@ -34,7 +34,7 @@ index 1c0b587..154a59b 100644
          { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
          { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
 diff --git a/dwm.c b/dwm.c
-index b0b3466..cf2550a 100644
+index b0b3466..d871457 100644
 --- a/dwm.c
 +++ b/dwm.c
 _AT_@ -172,6 +172,7 @@ static void focusstack(const Arg *arg);
_AT_@ -124,7 +124,7 @@ index b0b3466..cf2550a 100644
          }
  
          for (c = m->clients; c; c = c->next) {
-_AT_@ -872,6 +907,29 @@ getatomprop(Client *c, Atom prop)
+_AT_@ -872,6 +907,30 @@ getatomprop(Client *c, Atom prop)
          return atom;
  }
  
_AT_@ -148,13 +148,14 @@ index b0b3466..cf2550a 100644
 + if (!(fp = popen("pidof -s "STATUSBAR, "r")))
 + return -1;
 + fgets(buf, sizeof(buf), fp);
-+ return pclose(fp) == 0 ? strtol(buf, NULL, 10) : -1;
++ pclose(fp);
++ return strtol(buf, NULL, 10);
 +}
 +
  int
  getrootptr(int *x, int *y)
  {
-_AT_@ -1637,6 +1695,20 @@ sigchld(int unused)
+_AT_@ -1637,6 +1696,20 @@ sigchld(int unused)
          while (0 < waitpid(-1, NULL, WNOHANG));
  }
  
_AT_@ -166,7 +167,7 @@ index b0b3466..cf2550a 100644
 + if (!statussig)
 + return;
 + sv.sival_int = arg->i;
-+ if ((statuspid = getstatusbarpid()) < 0)
++ if ((statuspid = getstatusbarpid()) <= 0)
 + return;
 +
 + sigqueue(statuspid, SIGRTMIN+statussig, sv);
_AT_@ -175,7 +176,7 @@ index b0b3466..cf2550a 100644
  void
  spawn(const Arg *arg)
  {
-_AT_@ -1990,8 +2062,25 @@ updatesizehints(Client *c)
+_AT_@ -1990,8 +2063,25 @@ updatesizehints(Client *c)
  void
  updatestatus(void)
  {
diff --git a/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-status2d-20210402-60bb3df.diff b/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-status2d-20210405-60bb3df.diff
similarity index 93%
rename from dwm.suckless.org/patches/statuscmd/dwm-statuscmd-status2d-20210402-60bb3df.diff
rename to dwm.suckless.org/patches/statuscmd/dwm-statuscmd-status2d-20210405-60bb3df.diff
index 6160f52a..4adb383a 100644
--- a/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-status2d-20210402-60bb3df.diff
+++ b/dwm.suckless.org/patches/statuscmd/dwm-statuscmd-status2d-20210405-60bb3df.diff
_AT_@ -1,12 +1,12 @@
-From 9e7935657bdea456db3eb858ac44bb0a671c2b7a Mon Sep 17 00:00:00 2001
+From 05f9b3c45d4267d52724b2a76f333ba00353cab3 Mon Sep 17 00:00:00 2001
 From: Daniel Bylinka <daniel.bylinka_AT_gmail.com>
 Date: Fri, 2 Apr 2021 19:04:58 +0200
 Subject: [PATCH] [statuscmd] status2d compatibility
 
 ---
  config.def.h | 6 +++-
- dwm.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++----
- 2 files changed, 82 insertions(+), 6 deletions(-)
+ dwm.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++----
+ 2 files changed, 83 insertions(+), 6 deletions(-)
 
 diff --git a/config.def.h b/config.def.h
 index 1c0b587..154a59b 100644
_AT_@ -33,7 +33,7 @@ index 1c0b587..154a59b 100644
          { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
          { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
 diff --git a/dwm.c b/dwm.c
-index acbe6c9..da746a1 100644
+index acbe6c9..ba478b9 100644
 --- a/dwm.c
 +++ b/dwm.c
 _AT_@ -173,6 +173,7 @@ static void focusstack(const Arg *arg);
_AT_@ -131,7 +131,7 @@ index acbe6c9..da746a1 100644
          }
  
          for (c = m->clients; c; c = c->next) {
-_AT_@ -979,6 +1014,29 @@ getatomprop(Client *c, Atom prop)
+_AT_@ -979,6 +1014,30 @@ getatomprop(Client *c, Atom prop)
          return atom;
  }
  
_AT_@ -155,13 +155,14 @@ index acbe6c9..da746a1 100644
 + if (!(fp = popen("pidof -s "STATUSBAR, "r")))
 + return -1;
 + fgets(buf, sizeof(buf), fp);
-+ return pclose(fp) == 0 ? strtoul(buf, NULL, 10) : -1;
++ pclose(fp);
++ return strtoul(buf, NULL, 10);
 +}
 +
  int
  getrootptr(int *x, int *y)
  {
-_AT_@ -1745,6 +1803,20 @@ sigchld(int unused)
+_AT_@ -1745,6 +1804,20 @@ sigchld(int unused)
          while (0 < waitpid(-1, NULL, WNOHANG));
  }
  
Received on Tue Apr 06 2021 - 23:36:25 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 06 2021 - 23:36:52 CEST