Deleted Added
full compact
rmjob.c (15646) rmjob.c (15648)
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35static char sccsid[] = "@(#)rmjob.c 8.1 (Berkeley) 6/6/93";
35static char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95";
36#endif /* not lint */
37
38#include <sys/param.h>
39
40#include <signal.h>
41#include <errno.h>
42#include <dirent.h>
43#include <unistd.h>

--- 243 unchanged lines hidden (view full) ---

287 */
288void
289rmremote()
290{
291 register char *cp;
292 register int i, rem;
293 char buf[BUFSIZ];
294
36#endif /* not lint */
37
38#include <sys/param.h>
39
40#include <signal.h>
41#include <errno.h>
42#include <dirent.h>
43#include <unistd.h>

--- 243 unchanged lines hidden (view full) ---

287 */
288void
289rmremote()
290{
291 register char *cp;
292 register int i, rem;
293 char buf[BUFSIZ];
294
295 if (!sendtorem)
295 if (!remote)
296 return; /* not sending to a remote machine */
297
298 /*
299 * Flush stdout so the user can see what has been deleted
300 * while we wait (possibly) for the connection.
301 */
302 fflush(stdout);
303

--- 4 unchanged lines hidden (view full) ---

308 *cp++ = ' ';
309 strcpy(cp, user[i]);
310 }
311 for (i = 0; i < requests; i++) {
312 cp += strlen(cp);
313 (void) sprintf(cp, " %d", requ[i]);
314 }
315 strcat(cp, "\n");
296 return; /* not sending to a remote machine */
297
298 /*
299 * Flush stdout so the user can see what has been deleted
300 * while we wait (possibly) for the connection.
301 */
302 fflush(stdout);
303

--- 4 unchanged lines hidden (view full) ---

308 *cp++ = ' ';
309 strcpy(cp, user[i]);
310 }
311 for (i = 0; i < requests; i++) {
312 cp += strlen(cp);
313 (void) sprintf(cp, " %d", requ[i]);
314 }
315 strcat(cp, "\n");
316 rem = getport(RM);
316 rem = getport(RM, 0);
317 if (rem < 0) {
318 if (from != host)
319 printf("%s: ", host);
320 printf("connection to %s is down\n", RM);
321 } else {
322 i = strlen(buf);
323 if (write(rem, buf, i) != i)
324 fatal("Lost connection");

--- 15 unchanged lines hidden ---
317 if (rem < 0) {
318 if (from != host)
319 printf("%s: ", host);
320 printf("connection to %s is down\n", RM);
321 } else {
322 i = strlen(buf);
323 if (write(rem, buf, i) != i)
324 fatal("Lost connection");

--- 15 unchanged lines hidden ---