rtools were deemed almost unused 15 years ago...
John
jwd at FreeBSD.org
Mon Jun 26 12:43:49 UTC 2017
----- Jeremie Le Hen's Original Message -----
> On Sun, Jun 25, 2017 at 3:09 PM, Slawa Olhovchenkov <slw at zxy.spb.ru> wrote:
> > On Sat, Jun 24, 2017 at 10:29:22PM +0200, Jeremie Le Hen wrote:
> >
> >> So the first step was to create a port with FreeBSD rcmds, here we
> >> are! But I need some eyes to vet it:
> >> https://reviews.freebsd.org/D11345
> >
> > 1. Create port
> > 2. Port unmantained
> > 3. Port broken
> > 4. Port removed.
> > 5. Lack of functionality.
>
> Feel free to step in to help with the maintenance :-).
Let's commit this little snippet which is a major win for HA heads
with 10 of thousands of file descriptors open...
Index: libexec/rshd/rshd.c
===================================================================
--- libexec/rshd/rshd.c (revision 316672)
+++ libexec/rshd/rshd.c (working copy)
@@ -191,7 +191,7 @@
struct passwd *pwd;
u_short port;
fd_set ready, readfrom;
- int cc, fd, nfd, pv[2], pid, s;
+ int cc, nfd, pv[2], pid, s;
int one = 1;
const char *cp, *errorstr;
char sig, buf[BUFSIZ];
@@ -496,8 +496,7 @@
#ifdef USE_BLACKLIST
blacklist(0, STDIN_FILENO, "success");
#endif
- for (fd = getdtablesize(); fd > 2; fd--)
- (void) close(fd);
+ closefrom(3);
if (setsid() == -1)
syslog(LOG_ERR, "setsid() failed: %m");
if (setlogin(pwd->pw_name) < 0)
Cheers,
John
> --
> Jeremie Le Hen
> jlh at FreeBSD.org
> _______________________________________________
> freebsd-arch at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arch
> To unsubscribe, send any mail to "freebsd-arch-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 585 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20170626/ac19855e/attachment.sig>
More information about the freebsd-arch
mailing list