Compare commits

...

No commits in common. "7ab17d3d092012b69d8b1c6ce72de1d226abccf8" and "82ffbac28b0cba89cc26f2be3e5f34d382939197" have entirely different histories.

6 changed files with 22 additions and 2206 deletions

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
# Files generated by configure
/Makefile
/config.h
/config.log
/config.status
/configure.lineno
# Files generated by make
*.o
/dtach

View File

@ -1,36 +0,0 @@
srcdir = .
CC = gcc
CFLAGS = -g -O2 -W -Wall -I.
LDFLAGS =
LIBS = -lutil
VERSION = 0.9
OBJ = attach.o master.o main.o
SRC = $(srcdir)/attach.c $(srcdir)/master.c $(srcdir)/main.c
TARFILES = $(srcdir)/README $(srcdir)/COPYING $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(SRC) \
$(srcdir)/dtach.h $(srcdir)/dtach.spec $(srcdir)/configure \
$(srcdir)/configure.ac $(srcdir)/dtach.1
dtach: $(OBJ)
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
clean:
rm -f dtach $(OBJ) dtach-$(VERSION).tar.gz
distclean: clean
rm -f config.h Makefile config.log config.status config.cache
tar:
mkdir dtach-$(VERSION)
cp $(TARFILES) dtach-$(VERSION)
tar -cf dtach-$(VERSION).tar dtach-$(VERSION)/
gzip -9f dtach-$(VERSION).tar
rm -rf dtach-$(VERSION)
attach.o: ./attach.c ./dtach.h config.h
master.o: ./master.c ./dtach.h config.h
main.o: ./main.c ./dtach.h config.h

View File

@ -40,8 +40,8 @@ restore_term(void)
tcsetattr(0, TCSADRAIN, &orig_term);
/* Make cursor visible. Assumes VT100. */
printf("\033[?25h");
fflush(stdout);
printf("\033[?25h\033[?1049l");
fflush(stdout);
}
/* Connects to a unix domain socket */
@ -214,7 +214,9 @@ attach_main(int noerror)
tcsetattr(0, TCSADRAIN, &cur_term);
/* Clear the screen. This assumes VT100. */
//write(1, "\33[H\33[J", 6);
printf("\033[?1049h\033[H");
fflush(stdout);
/* write(1, "\33[H\33[J", 6); */
/* Tell the master that we want to attach. */
memset(&pkt, 0, sizeof(struct packet));
@ -238,7 +240,8 @@ attach_main(int noerror)
n = select(s + 1, &readfds, NULL, NULL, NULL);
if (n < 0 && errno != EINTR && errno != EAGAIN)
{
printf(EOS "\r\n[select failed]\r\n");
restore_term();
printf(EOS "[select failed]\r\n");
exit(1);
}
@ -249,13 +252,14 @@ attach_main(int noerror)
if (len == 0)
{
printf(EOS "\r\n[EOF - dtach terminating]"
"\r\n");
restore_term();
printf(EOS "[EOF - dtach terminating]\r\n");
exit(0);
}
else if (len < 0)
{
printf(EOS "\r\n[read returned an error]\r\n");
restore_term();
printf(EOS "[read returned an error]\r\n");
exit(1);
}
/* Send the data to the terminal. */

137
config.h
View File

@ -1,137 +0,0 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the `atexit' function. */
#define HAVE_ATEXIT 1
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `forkpty' function. */
#define HAVE_FORKPTY 1
/* Define to 1 if you have the `grantpt' function. */
#define HAVE_GRANTPT 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Define to 1 if you have the `util' library (-lutil). */
#define HAVE_LIBUTIL 1
/* Define to 1 if you have the <libutil.h> header file. */
/* #undef HAVE_LIBUTIL_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `openpty' function. */
#define HAVE_OPENPTY 1
/* Define to 1 if you have the `ptsname' function. */
#define HAVE_PTSNAME 1
/* Define to 1 if you have the <pty.h> header file. */
#define HAVE_PTY_H 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <stropts.h> header file. */
#define HAVE_STROPTS_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `unlockpt' function. */
#define HAVE_UNLOCKPT 1
/* Define to 1 if you have the <util.h> header file. */
/* #undef HAVE_UTIL_H */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "crigler@users.sourceforge.net"
/* Define to the full name of this package. */
#define PACKAGE_NAME "dtach"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "dtach 0.9"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "dtach"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.9"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */

1016
config.log

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff