diff options
| author | Ned T. Crigler <crigler@gmail.com> | 2025-06-20 10:34:32 -0700 |
|---|---|---|
| committer | Ned T. Crigler <crigler@gmail.com> | 2025-06-20 19:16:27 -0700 |
| commit | b027c27b2439081064d07a86883c8e0b20a183c9 (patch) | |
| tree | a329fcba604faf292647e8bc242b0ffe040b3285 | |
| parent | e34e2bb3c703aa8c47d85ba4b4a86f6ae5dc0404 (diff) | |
| -rw-r--r-- | Makefile.in | 1 | ||||
| -rw-r--r-- | README | 2 | ||||
| -rw-r--r-- | attach.c | 8 | ||||
| -rw-r--r-- | dtach.1 | 4 | ||||
| -rw-r--r-- | dtach.spec | 8 | ||||
| -rw-r--r-- | main.c | 99 | ||||
| -rw-r--r-- | master.c | 18 |
7 files changed, 70 insertions, 70 deletions
diff --git a/Makefile.in b/Makefile.in index 11afcd3..8e756cd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -33,4 +33,3 @@ tar: attach.o: @srcdir@/attach.c @srcdir@/dtach.h config.h master.o: @srcdir@/master.c @srcdir@/dtach.h config.h main.o: @srcdir@/main.c @srcdir@/dtach.h config.h - @@ -200,7 +200,7 @@ The changes in version 0.3 are: possible. - Added some more autoconf checks. - Initial sourceforge release. - + 7. AUTHOR dtach is (C)Copyright 2004-2016 Ned T. Crigler, and is under the GNU General @@ -62,7 +62,7 @@ connect_socket(char *name) return -1; sockun.sun_family = AF_UNIX; strcpy(sockun.sun_path, name); - if (connect(s, (struct sockaddr*)&sockun, sizeof(sockun)) < 0) + if (connect(s, (struct sockaddr *)&sockun, sizeof(sockun)) < 0) { close(s); @@ -152,7 +152,7 @@ attach_main(int noerror) fd_set readfds; int s; - /* Attempt to open the socket. Don't display an error if noerror is + /* Attempt to open the socket. Don't display an error if noerror is ** set. */ s = connect_socket(sockname); if (s < 0 && errno == ENAMETOOLONG) @@ -185,7 +185,7 @@ attach_main(int noerror) { if (!noerror) printf("%s: %s: %s\n", progname, sockname, - strerror(errno)); + strerror(errno)); return 1; } @@ -254,7 +254,7 @@ attach_main(int noerror) if (len == 0) { printf(EOS "\r\n[EOF - dtach terminating]" - "\r\n"); + "\r\n"); exit(0); } else if (len < 0) @@ -41,7 +41,7 @@ The program is disassociated from the original terminal, and is thus protected from your original terminal being disconnected for some reason. .PP -Other instances of +Other instances of .B dtach can attach themselves to a particular session. Input and output is copied between the program running in the @@ -76,7 +76,7 @@ Attach to an existing session. attaches itself to the session specified by .IR <socket> . After the attach is completed, the window size of the current terminal is sent -to the master process, and a redraw is also requested. +to the master process, and a redraw is also requested. .TP .B \-A Attach to an existing session, or create a new one. @@ -7,7 +7,7 @@ URL: http://dtach.sourceforge.net Group: Applications/System Source: http://prdownloads.sourceforge.net/dtach/dtach-%{version}.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-root - + %description dtach is a program that emulates the detach feature of screen, with @@ -15,14 +15,14 @@ less overhead. It is designed to be transparent and un-intrusive; it avoids interpreting the input and output between attached terminals and the program under its control. Consequently, it works best with full-screen applications such as emacs. - + %prep %setup - + %build %configure make - + %install rm -rf $RPM_BUILD_ROOT/* mkdir -p $RPM_BUILD_ROOT/%{_bindir} @@ -92,36 +92,36 @@ static void usage() { printf( - "dtach - version %s, compiled on %s at %s.\n" - "Usage: dtach -a <socket> <options>\n" - " dtach -A <socket> <options> <command...>\n" - " dtach -c <socket> <options> <command...>\n" - " dtach -n <socket> <options> <command...>\n" - " dtach -N <socket> <options> <command...>\n" - " dtach -p <socket>\n" - "Modes:\n" - " -a\t\tAttach to the specified socket.\n" - " -A\t\tAttach to the specified socket, or create it if it\n" - "\t\t does not exist, running the specified command.\n" - " -c\t\tCreate a new socket and run the specified command.\n" - " -n\t\tCreate a new socket and run the specified command " - "detached.\n" - " -N\t\tCreate a new socket and run the specified command " - "detached,\n" - "\t\t and have dtach run in the foreground.\n" - " -p\t\tCopy the contents of standard input to the specified\n" - "\t\t socket.\n" - "Options:\n" - " -e <char>\tSet the detach character to <char>, defaults " - "to ^\\.\n" - " -E\t\tDisable the detach character.\n" - " -r <method>\tSet the redraw method to <method>. The " - "valid methods are:\n" - "\t\t none: Don't redraw at all.\n" - "\t\t ctrl_l: Send a Ctrl L character to the program.\n" - "\t\t winch: Send a WINCH signal to the program.\n" - " -z\t\tDisable processing of the suspend key.\n" - "\nReport any bugs to <" PACKAGE_BUGREPORT ">.\n", + "dtach - version %s, compiled on %s at %s.\n" + "Usage: dtach -a <socket> <options>\n" + " dtach -A <socket> <options> <command...>\n" + " dtach -c <socket> <options> <command...>\n" + " dtach -n <socket> <options> <command...>\n" + " dtach -N <socket> <options> <command...>\n" + " dtach -p <socket>\n" + "Modes:\n" + " -a\t\tAttach to the specified socket.\n" + " -A\t\tAttach to the specified socket, or create it if it\n" + "\t\t does not exist, running the specified command.\n" + " -c\t\tCreate a new socket and run the specified command.\n" + " -n\t\tCreate a new socket and run the specified command " + "detached.\n" + " -N\t\tCreate a new socket and run the specified command " + "detached,\n" + "\t\t and have dtach run in the foreground.\n" + " -p\t\tCopy the contents of standard input to the specified\n" + "\t\t socket.\n" + "Options:\n" + " -e <char>\tSet the detach character to <char>, defaults " + "to ^\\.\n" + " -E\t\tDisable the detach character.\n" + " -r <method>\tSet the redraw method to <method>. The " + "valid methods are:\n" + "\t\t none: Don't redraw at all.\n" + "\t\t ctrl_l: Send a Ctrl L character to the program.\n" + "\t\t winch: Send a WINCH signal to the program.\n" + " -z\t\tDisable processing of the suspend key.\n" + "\nReport any bugs to <" PACKAGE_BUGREPORT ">.\n", PACKAGE_VERSION, __DATE__, __TIME__); exit(0); } @@ -143,7 +143,7 @@ main(int argc, char **argv) else if (strncmp(*argv, "--version", strlen(*argv)) == 0) { printf("dtach - version %s, compiled on %s at %s.\n", - PACKAGE_VERSION, __DATE__, __TIME__); + PACKAGE_VERSION, __DATE__, __TIME__); return 0; } @@ -155,7 +155,7 @@ main(int argc, char **argv) { printf("%s: Invalid mode '-%c'\n", progname, mode); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } } @@ -163,7 +163,7 @@ main(int argc, char **argv) { printf("%s: No mode was specified.\n", progname); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } ++argv; --argc; @@ -172,7 +172,7 @@ main(int argc, char **argv) { printf("%s: No socket was specified.\n", progname); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } sockname = *argv; @@ -183,9 +183,9 @@ main(int argc, char **argv) if (argc > 0) { printf("%s: Invalid number of arguments.\n", - progname); + progname); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } return push_main(); @@ -195,7 +195,8 @@ main(int argc, char **argv) { char *p; - if (strcmp(argv[0], "--") == 0) { + if (strcmp(argv[0], "--") == 0) + { ++argv; --argc; break; } @@ -212,9 +213,9 @@ main(int argc, char **argv) if (argc < 1) { printf("%s: No escape character " - "specified.\n", progname); + "specified.\n", progname); printf("Try '%s --help' for more " - "information.\n", progname); + "information.\n", progname); return 1; } if (argv[0][0] == '^' && argv[0][1]) @@ -234,9 +235,9 @@ main(int argc, char **argv) if (argc < 1) { printf("%s: No redraw method " - "specified.\n", progname); + "specified.\n", progname); printf("Try '%s --help' for more " - "information.\n", progname); + "information.\n", progname); return 1; } if (strcmp(argv[0], "none") == 0) @@ -248,9 +249,9 @@ main(int argc, char **argv) else { printf("%s: Invalid redraw method " - "specified.\n", progname); + "specified.\n", progname); printf("Try '%s --help' for more " - "information.\n", progname); + "information.\n", progname); return 1; } break; @@ -258,9 +259,9 @@ main(int argc, char **argv) else { printf("%s: Invalid option '-%c'\n", - progname, *p); + progname, *p); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } } @@ -271,7 +272,7 @@ main(int argc, char **argv) { printf("%s: No command was specified.\n", progname); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } @@ -285,7 +286,7 @@ main(int argc, char **argv) if (dont_have_tty && mode != 'n' && mode != 'N') { printf("%s: Attaching to a session requires a terminal.\n", - progname); + progname); return 1; } @@ -294,9 +295,9 @@ main(int argc, char **argv) if (argc > 0) { printf("%s: Invalid number of arguments.\n", - progname); + progname); printf("Try '%s --help' for more information.\n", - progname); + progname); return 1; } return attach_main(0); @@ -55,7 +55,7 @@ static struct pty the_pty; #ifndef HAVE_FORKPTY pid_t forkpty(int *amaster, char *name, struct termios *termp, - struct winsize *winp); + struct winsize *winp); #endif /* Unlink the socket */ @@ -66,7 +66,7 @@ unlink_socket(void) } /* Signal */ -static RETSIGTYPE +static RETSIGTYPE die(int sig) { /* Well, the child died. */ @@ -165,11 +165,11 @@ killpty(struct pty *pty, int sig) #ifdef TIOCGPGRP #ifdef BROKEN_MASTER if (ioctl(pty->slave, TIOCGPGRP, &pgrp) >= 0 && pgrp != -1 && - kill(-pgrp, sig) >= 0) + kill(-pgrp, sig) >= 0) return; #endif if (ioctl(pty->fd, TIOCGPGRP, &pgrp) >= 0 && pgrp != -1 && - kill(-pgrp, sig) >= 0) + kill(-pgrp, sig) >= 0) return; #endif @@ -200,7 +200,7 @@ create_socket(char *name) } sockun.sun_family = AF_UNIX; strcpy(sockun.sun_path, name); - if (bind(s, (struct sockaddr*)&sockun, sizeof(sockun)) < 0) + if (bind(s, (struct sockaddr *)&sockun, sizeof(sockun)) < 0) { umask(omask); /* umask always succeeds, errno is untouched. */ close(s); @@ -344,7 +344,7 @@ control_activity(int s) { int fd; struct client *p; - + /* Accept the new client and link it in. */ fd = accept(s, NULL, NULL); if (fd < 0) @@ -387,7 +387,7 @@ client_activity(struct client *p) *(p->pprev) = p->next; free(p); return; - } + } /* Push out data to the program. */ if (pkt.type == MSG_PUSH) @@ -431,8 +431,8 @@ client_activity(struct client *p) { char c = '\f'; - if (((the_pty.term.c_lflag & (ECHO|ICANON)) == 0) && - (the_pty.term.c_cc[VMIN] == 1)) + if (((the_pty.term.c_lflag & (ECHO|ICANON)) == 0) && + (the_pty.term.c_cc[VMIN] == 1)) { write_buf_or_fail(the_pty.fd, &c, 1); } |
