- int pid, status;
- char full_tty[32];
- FILE *tf;
- struct stat stbuf;
-
-
- (void) sprintf(full_tty, "/dev/%s", request->r_tty);
-
- if (access(full_tty, 0) != 0) {
- return(FAILED);
- }
-
- if ((tf = fopen(full_tty, "w")) == NULL) {
- return(PERMISSION_DENIED);
- }
-
- /* open gratuitously attaches the talkd to
- any tty it opens, so disconnect us from the
- tty before we catch a signal */
-
- ioctl(fileno(tf), TIOCNOTTY, (struct sgttyb *) 0);
-
- if (fstat(fileno(tf), &stbuf) < 0) {
- return(PERMISSION_DENIED);
- }
-
- if ((stbuf.st_mode&02) == 0) {
- return(PERMISSION_DENIED);
- }
-
- print_mesg(tf, request, remote_machine);
- fclose(tf);
- return(SUCCESS);
+ int pid, status;
+ char full_tty[32];
+ FILE *tf;
+ struct stat stbuf;
+
+ (void) sprintf(full_tty, "/dev/%s", request->r_tty);
+ if (access(full_tty, 0) != 0)
+ return (FAILED);
+ if ((tf = fopen(full_tty, "w")) == NULL)
+ return (PERMISSION_DENIED);
+ /*
+ * Open gratuitously attaches the talkd to
+ * any tty it opens, so disconnect us from the
+ * tty before we catch a signal
+ */
+ ioctl(fileno(tf), TIOCNOTTY, (struct sgttyb *) 0);
+ if (fstat(fileno(tf), &stbuf) < 0)
+ return (PERMISSION_DENIED);
+ if ((stbuf.st_mode&02) == 0)
+ return (PERMISSION_DENIED);
+ print_mesg(tf, request, remote_machine);
+ fclose(tf);
+ return (SUCCESS);