Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109824265
D41469.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D41469.diff
View Options
diff --git a/sysutils/screen/Makefile b/sysutils/screen/Makefile
--- a/sysutils/screen/Makefile
+++ b/sysutils/screen/Makefile
@@ -1,6 +1,6 @@
PORTNAME= screen
PORTVERSION= 4.9.0
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= sysutils
MASTER_SITES= GNU \
ftp://ftp.gnu.org/gnu/screen/ \
diff --git a/sysutils/screen/files/patch-doc_screen.1 b/sysutils/screen/files/patch-doc_screen.1
new file mode 100644
--- /dev/null
+++ b/sysutils/screen/files/patch-doc_screen.1
@@ -0,0 +1,11 @@
+--- doc/screen.1.orig 2023-08-15 11:01:59 UTC
++++ doc/screen.1
+@@ -241,7 +241,7 @@
+ .IR screen ,
+ but prints a list of
+ .I pid.tty.host
+-strings identifying your
++strings and creation timestamps identifying your
+ .I screen
+ sessions.
+ Sessions marked `detached' can be resumed with \*Qscreen \-r\*U. Those marked
diff --git a/sysutils/screen/files/patch-extern.h b/sysutils/screen/files/patch-extern.h
new file mode 100644
--- /dev/null
+++ b/sysutils/screen/files/patch-extern.h
@@ -0,0 +1,8 @@
+--- extern.h.orig 2023-08-15 08:44:47 UTC
++++ extern.h
+@@ -512,3 +512,5 @@
+ /* layout.c */
+ extern void RemoveLayout __P((struct layout *));
+ extern int LayoutDumpCanvas __P((struct canvas *, char *));
++
++extern time_t SessionCreationTime __P((const char *));
diff --git a/sysutils/screen/files/patch-misc.c b/sysutils/screen/files/patch-misc.c
new file mode 100644
--- /dev/null
+++ b/sysutils/screen/files/patch-misc.c
@@ -0,0 +1,31 @@
+--- misc.c.orig 2022-01-28 14:06:02 UTC
++++ misc.c
+@@ -28,8 +28,10 @@
+
+ #include <poll.h>
+ #include <sys/types.h>
++#include <sys/user.h>
+ #include <sys/stat.h> /* mkdir() declaration */
+ #include <signal.h>
++#include <libutil.h>
+
+ #include "config.h"
+ #include "screen.h"
+@@ -796,3 +798,17 @@
+ }
+
+ #endif
++
++time_t
++SessionCreationTime(fifo)
++const char *fifo;
++{
++ int pid = atoi(fifo);
++ if (pid <= 0) return 0;
++
++ struct kinfo_proc * kip = kinfo_getproc(pid);
++ if (kip == 0) return 0;
++ time_t start = kip->ki_start.tv_sec;
++ free (kip);
++ return start;
++}
diff --git a/sysutils/screen/files/patch-socket.c b/sysutils/screen/files/patch-socket.c
new file mode 100644
--- /dev/null
+++ b/sysutils/screen/files/patch-socket.c
@@ -0,0 +1,84 @@
+--- socket.c.orig 2022-01-28 14:06:02 UTC
++++ socket.c
+@@ -141,12 +141,14 @@
+ char *firstn = NULL;
+ int nfound = 0, ngood = 0, ndead = 0, nwipe = 0, npriv = 0;
+ int nperfect = 0;
++ char timestr[64];
+ struct sent
+ {
+ struct sent *next;
+ int mode;
+ char *name;
+- } *slist, **slisttail, *sent, *nsent;
++ time_t time_created;
++ } *slist, **slisttail, *sent, *nsent, *schosen;
+
+ if (match)
+ {
+@@ -258,8 +260,13 @@
+ sent->next = 0;
+ sent->name = SaveStr(name);
+ sent->mode = mode;
++ sent->time_created = SessionCreationTime(name);
++ for (slisttail = &slist; *slisttail; slisttail = &((*slisttail)->next))
++ {
++ if ((*slisttail)->time_created < sent->time_created) break;
++ }
++ sent->next = *slisttail;
+ *slisttail = sent;
+- slisttail = &sent->next;
+ nfound++;
+ sockfd = MakeClientSocket(0, *is_sock);
+ #ifdef USE_SETEUID
+@@ -359,34 +366,42 @@
+ }
+ for (sent = slist; sent; sent = sent->next)
+ {
++ if (sent->time_created == 0)
++ {
++ sprintf(timestr, "??" "?");
++ }
++ else
++ {
++ strftime(timestr, 64, "%x %X", localtime(&sent->time_created));
++ }
+ switch (sent->mode)
+ {
+ case 0700:
+- printf("\t%s\t(Attached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Attached)\n", sent->name, timestr);
+ break;
+ case 0600:
+- printf("\t%s\t(Detached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Detached)\n", sent->name, timestr);
+ break;
+ #ifdef MULTIUSER
+ case 0701:
+- printf("\t%s\t(Multi, attached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Multi, attached)\n", sent->name, timestr);
+ break;
+ case 0601:
+- printf("\t%s\t(Multi, detached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Multi, detached)\n", sent->name, timestr);
+ break;
+ #endif
+ case -1:
+ /* No trigraphs here! */
+- printf("\t%s\t(Dead ?%c?)\n", sent->name, '?');
++ printf("\t%s\t(%s)\t(Dead ?%c?)\n", sent->name, timestr, '?');
+ break;
+ case -2:
+- printf("\t%s\t(Removed)\n", sent->name);
++ printf("\t%s\t(%s)\t(Removed)\n", sent->name, timestr);
+ break;
+ case -3:
+- printf("\t%s\t(Remote or dead)\n", sent->name);
++ printf("\t%s\t(%s)\t(Remote or dead)\n", sent->name, timestr);
+ break;
+ case -4:
+- printf("\t%s\t(Private)\n", sent->name);
++ printf("\t%s\t(%s)\t(Private)\n", sent->name, timestr);
+ break;
+ }
+ }
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 12:25 AM (9 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16586048
Default Alt Text
D41469.diff (4 KB)
Attached To
Mode
D41469: Reimplement debian patches to display screen session creation time and sort the list of sessions by date.
Attached
Detach File
Event Timeline
Log In to Comment