inetd.c (225736) | inetd.c (236875) |
---|---|
1/* 2 * Copyright (c) 1983, 1991, 1993, 1994 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 --- 26 unchanged lines hidden (view full) --- 35 36#ifndef lint 37#if 0 38static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94"; 39#endif 40#endif /* not lint */ 41 42#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1983, 1991, 1993, 1994 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 --- 26 unchanged lines hidden (view full) --- 35 36#ifndef lint 37#if 0 38static char sccsid[] = "@(#)from: inetd.c 8.4 (Berkeley) 4/13/94"; 39#endif 40#endif /* not lint */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: stable/9/usr.sbin/inetd/inetd.c 201387 2010-01-02 11:05:34Z ed $"); | 43__FBSDID("$FreeBSD: stable/9/usr.sbin/inetd/inetd.c 236875 2012-06-11 07:11:34Z delphij $"); |
44 45/* 46 * Inetd - Internet super-server 47 * 48 * This program invokes all internet services as needed. Connection-oriented 49 * services are invoked each time a connection is made, by creating a process. 50 * This process is passed the connection as file descriptor 0 and is expected 51 * to do a getpeername to find out the source host and port. --- 631 unchanged lines hidden (view full) --- 683 pid = 0; 684 /* 685 * Fork for all external services, builtins which need to 686 * fork and anything we're wrapping (as wrapping might 687 * block or use hosts_options(5) twist). 688 */ 689 if (dofork) { 690 if (sep->se_count++ == 0) | 44 45/* 46 * Inetd - Internet super-server 47 * 48 * This program invokes all internet services as needed. Connection-oriented 49 * services are invoked each time a connection is made, by creating a process. 50 * This process is passed the connection as file descriptor 0 and is expected 51 * to do a getpeername to find out the source host and port. --- 631 unchanged lines hidden (view full) --- 683 pid = 0; 684 /* 685 * Fork for all external services, builtins which need to 686 * fork and anything we're wrapping (as wrapping might 687 * block or use hosts_options(5) twist). 688 */ 689 if (dofork) { 690 if (sep->se_count++ == 0) |
691 (void)gettimeofday(&sep->se_time, (struct timezone *)NULL); | 691 (void)clock_gettime(CLOCK_MONOTONIC_FAST, &sep->se_time); |
692 else if (toomany > 0 && sep->se_count >= toomany) { | 692 else if (toomany > 0 && sep->se_count >= toomany) { |
693 struct timeval now; | 693 struct timespec now; |
694 | 694 |
695 (void)gettimeofday(&now, (struct timezone *)NULL); | 695 (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); |
696 if (now.tv_sec - sep->se_time.tv_sec > 697 CNT_INTVL) { 698 sep->se_time = now; 699 sep->se_count = 1; 700 } else { 701 syslog(LOG_ERR, 702 "%s/%s server failing (looping), service terminated", 703 sep->se_service, sep->se_proto); --- 1881 unchanged lines hidden --- | 696 if (now.tv_sec - sep->se_time.tv_sec > 697 CNT_INTVL) { 698 sep->se_time = now; 699 sep->se_count = 1; 700 } else { 701 syslog(LOG_ERR, 702 "%s/%s server failing (looping), service terminated", 703 sep->se_service, sep->se_proto); --- 1881 unchanged lines hidden --- |