search for: save_errno

Displaying 20 results from an estimated 37 matches for "save_errno".

Did you mean: saved_errno
2003 Dec 22
1
possible sigchld bug
Hi What if you have sysv signals (i.e. signal is restored when handler is called) and child process exits here? Zombie will be left, because SIGCHLD is ignored at that point. Shouldn't signal be before waitpid? Mikulas static void main_sigchld_handler(int sig) { int save_errno = errno; pid_t pid; int status; while ((pid = waitpid(-1, &status, WNOHANG)) > 0 || (pid < 0 && errno == EINTR)) ; <----- HERE signal(SIGCHLD, main_sigchld_handler); errno = save_errno; }
2002 Mar 28
1
rsync raising an IO error for an excluded file
...e.sys: Permission denied IO error encountered - skipping file deletion pagefile.sys is however in the exclude-list, so I think rsync shouldn't care that it can't stat the file. The code fragment responsible is if (readlink_stat(fname, &st, linkbuf) != 0) { int save_errno = errno; if ((errno == ENOENT) && copy_links && !noexcludes) { /* symlink pointing nowhere, see if excluded */ memset((char *) &st, 0, sizeof(st)); if (check_exclude_file(f, fname, &st))...
2000 Dec 12
1
reinstalling SIGCHLD handler before wait()
HP-UX 11 is looping on SIGCHLD/sigchld_handler2() when exiting a protocol 2 session apparently because we don't call wait before reinstalling the handler. Any thoughts on this issue or how to address it? serverloop.c from latest snapshots: void sigchld_handler2(int sig) { int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; signal(SIGCHLD, sigchld_handler2); errno = save_errno; } from signal(5) on HP-UX 11 (SIGCLD is the same as SIGCHLD): If one of the signal interface routines is used to set the action...
2002 Mar 29
1
Two patches for OpenSSH 3.1p1 (fwd)
...} RAND_add(&status, sizeof(&status), 0.0); diff -r -c openssh-3.1p1/sshd.c openssh-3.1p1-peter/sshd.c *** openssh-3.1p1/sshd.c Tue Mar 5 02:31:30 2002 --- openssh-3.1p1-peter/sshd.c Mon Mar 18 22:03:37 2002 *************** *** 264,273 **** main_sigchld_handler(int sig) { int save_errno = errno; ! int status; ! while (waitpid(-1, &status, WNOHANG) > 0) ! ; signal(SIGCHLD, main_sigchld_handler); errno = save_errno; --- 264,274 ---- main_sigchld_handler(int sig) { int save_errno = errno; ! int status, code; ! ! while ((code = waitpid(-1, &sta...
2002 Feb 06
2
SFTP Status Bar..
...progressmeter(1); + updateprogressmeter(1); + if (count != 0 && wrerr == NO && (j = atomicio(write, ofd, bp->buf, count)) != count) { wrerr = YES; @@ -1079,140 +1060,17 @@ } static void -updateprogressmeter(int ignore) +updateprogressmeter(int done) { - int save_errno = errno; - - progressmeter(0); - mysignal(SIGALRM, updateprogressmeter); - alarm(PROGRESSTIME); - errno = save_errno; -} - -static int -foregroundproc(void) -{ - static pid_t pgrp = -1; - int ctty_pgrp; - - if (pgrp == -1) - pgrp = getpgrp(); + int save_errno = errno; -#ifdef HAVE_TCGETPG...
1999 Nov 20
1
openssh and DOS
...@ -117,6 +117,9 @@ the private key. */ RSA *public_key; +/* Number of connections open at present. */ +int current_connections = 0; + /* Prototypes for various functions defined later in this file. */ void do_connection(); void do_authentication(char *user); @@ -316,7 +319,12 @@ { int save_errno = errno; int status; - wait(&status); + + /* Reap all the children that are dead. */ + while (waitpid (0, &status, WNOHANG) > 0) { + if (current_connections > 0) --current_connections; + } + signal(SIGCHLD, main_sigchld_handler); errno = save_errno; } @@ -687,27 +695,...
2004 Jan 19
1
File that "vanish"es between readdir and stat is not IO error
Using rsync 2.6.0 with --verbose and doing a pull. >?receiving file list ... readlink "{FILENAME}" failed: >?No such file or directory >?done >?IO error encountered - skipping file deletion The file was a temporary file that was being deleted just as the rsync was run. So while the file list was being built, it was there when the directory was read but had vanished by the
2002 Jan 30
1
Quick sftp status indicator.
...er(1); + progressmeter(1, statbytes, totalbytes, curfile); + if (count != 0 && wrerr == NO && (j = atomicio(write, ofd, bp->buf, count)) != count) { wrerr = YES; @@ -1039,140 +1032,14 @@ exit(1); } -static void +void updateprogressmeter(int ignore) -{ - int save_errno = errno; - - progressmeter(0); - signal(SIGALRM, updateprogressmeter); - alarm(PROGRESSTIME); - errno = save_errno; -} - -static int -foregroundproc(void) { - static pid_t pgrp = -1; - int ctty_pgrp; + int save_errno = errno; - if (pgrp == -1) - pgrp = getpgrp(); - - return ((ioctl(STDOU...
2002 Feb 02
0
Version two of progressbar for scp/sftp
...} } if (showprogress) - progressmeter(1); + updateprogressmeter(1); + if (count != 0 && wrerr == NO && (j = atomicio(write, ofd, bp->buf, count)) != count) { wrerr = YES; @@ -1040,139 +1029,18 @@ } static void -updateprogressmeter(int ignore) -{ - int save_errno = errno; - - progressmeter(0); - signal(SIGALRM, updateprogressmeter); - alarm(PROGRESSTIME); - errno = save_errno; -} - -static int -foregroundproc(void) -{ - static pid_t pgrp = -1; - int ctty_pgrp; - - if (pgrp == -1) - pgrp = getpgrp(); - - return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pg...
2002 Jun 25
2
Help wanted: configure test for busted mmap
Linux 2.2 (and probably others) have a deficient mmap which has caused a number of problems (e.g. bug #285). A workaround is in development, but it would be helpful to have a configure test to detect the bad mmaps(). Any takers? -d
2002 Mar 26
1
Two patches for OpenSSH 3.1p1
...} RAND_add(&status, sizeof(&status), 0.0); diff -r -c openssh-3.1p1/sshd.c openssh-3.1p1-peter/sshd.c *** openssh-3.1p1/sshd.c Tue Mar 5 02:31:30 2002 --- openssh-3.1p1-peter/sshd.c Mon Mar 18 22:03:37 2002 *************** *** 264,273 **** main_sigchld_handler(int sig) { int save_errno = errno; ! int status; ! while (waitpid(-1, &status, WNOHANG) > 0) ! ; signal(SIGCHLD, main_sigchld_handler); errno = save_errno; --- 264,274 ---- main_sigchld_handler(int sig) { int save_errno = errno; ! int status, code; ! ! while ((code = waitpid(-1, &sta...
2002 Dec 05
1
Patch to ignore exluded files.
...my syncs.... Here's the version that I came up with before finding Eugene's patch: --- rsync-2.5.5/flist.c.orig 2002-03-14 15:20:20.000000000 -0600 +++ rsync-2.5.5/flist.c 2002-12-02 19:27:02.000000000 -0600 @@ -644,8 +644,8 @@ if (readlink_stat(fname, &st, linkbuf) != 0) { int save_errno = errno; - if ((errno == ENOENT) && copy_links && !noexcludes) { - /* symlink pointing nowhere, see if excluded */ + if ((errno == ENOENT) && !noexcludes) { + /* File or directory not found, see if excluded */ memset((char *) &st, 0, sizeof(st)); if (check_...
2007 Nov 10
3
Funny issue with chroot + symlink outside chroot
...have side effect. (The patch is partial, the same should be applied to sender.c). diff -u -b -B -w -p -r1.468 flist.c --- flist.c 6 Nov 2007 15:25:02 -0000 1.468 +++ flist.c 10 Nov 2007 17:21:51 -0000 @@ -1026,8 +1026,8 @@ struct file_struct *make_file(const char if (save_errno == ENOENT) { #ifdef SUPPORT_LINKS /* Avoid "vanished" error if symlink points nowhere. */ - if (copy_links && x_lstat(thisname, &st, NULL) == 0 - && S_ISLNK(st.st_mode)) { +...
2020 Apr 02
1
can libvirt.so use jemalloc to manage mem ?
...{ if (err == NULL) return; VIR_FREE(err->message); VIR_FREE(err->str1); VIR_FREE(err->str2); VIR_FREE(err->str3); memset(err, 0, sizeof(virError)); } # define VIR_FREE(ptr) virFree(1 ? (void *) &(ptr) : (ptr)) void virFree(void *ptrptr) { int save_errno = errno; free(*(void**)ptrptr); *(void**)ptrptr = NULL; errno = save_errno; } when my daemon link with jemalloc must coreļ¼Œbut if i use glibc to manage memory ,then it work fine, why ?
2009 Mar 24
0
Issue with child process exits
...using honeyd as an IP emulator and experienced an issue with hangs on exit from ssh and sftp sessions. A quick look at the OpenSSH source code revealed the following: In serverloop.c there is a signal handler defined for SIGCHLD as follows: static void sigchld_handler(int sig) { int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; #ifndef _UNICOS mysignal(SIGCHLD, sigchld_handler); #endif notify_parent(); errno = save_errno; } As far as I can tell the primary purpose of this method is to set a value for child_terminated which is referenced by...
2001 Jan 18
1
sigchld_handler2.
...ried the last snapshots so I don't know if this was fixed. Here's a diff of what I did (basically just resetting it as it was for 2.3.0p1): *** serverloop.c.orig Thu Jan 18 08:41:13 EST 2001 --- serverloop.c Wed Jan 17 16:01:41 EST 2001 *************** *** 109,115 **** int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; - signal(SIGCHLD, sigchld_handler2); errno = save_errno; } --- 109,114 ---- *************** *** 667,672 **** --- 666,672 ---- if (child_terminated) { while...
2002 Apr 05
1
[Bug 100] serverloop.c modifications for correct UNICOS behavior
http://bugzilla.mindrot.org/show_bug.cgi?id=100 ------- Additional Comments From mouring at eviladmin.org 2002-04-06 06:52 ------- The following code was committed to OpenSSH to catch some SysV issue. Does this keep UNICOS happy? while ((wait_pid = waitpid(-1, &wait_status, 0)) < 0) if (errno != EINTR) packet_disconnect("wait:
2000 May 15
1
AIX authenticate patches
...(DISABLE_LASTLOG) */ +#endif /* defined(_PATH_LASTLOG) && !defined(DISABLE_LASTLOG) && !defined(WITH_AIXAUTHENTICATE) */ } /* Records that the user has logged out. */ --- serverloop.c.orig Wed May 10 14:34:00 2000 +++ serverloop.c Thu May 11 08:17:17 2000 @@ -85,7 +85,6 @@ int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; - signal(SIGCHLD, sigchld_handler2); errno = save_errno; } @@ -640,6 +639,7 @@ while ((pid = waitpid(-1, &status, WNOHANG)) > 0) session_close_by_pid(pid, status); child_terminated = 0; + signal(SIGC...
2001 Jan 19
1
Core dumps on HP-UX
Hello, I've been trying to get openssh working at our site recently, but have been running into these problems. In using the "release" version (openssh-2.3.0p1) we kept getting these broken pipe errors: zcat: stdout: Broken pipe Damien suggested we try out the snapshot versions, so I've been trying out the daily versions since last week. With the snapshots, the pipe problem
2001 Oct 31
2
suggested fix for the sigchld race
...readset)) + while (read(notify_pipe[0], &c, 1) != -1) + debug2("notify_done: reading"); +} + static void sigchld_handler(int sig) { @@ -99,6 +138,7 @@ debug("Received SIGCHLD."); child_terminated = 1; signal(SIGCHLD, sigchld_handler); + notify_parent(); errno = save_errno; } @@ -242,6 +282,7 @@ if (fdin != -1 && buffer_len(&stdin_buffer) > 0) FD_SET(fdin, *writesetp); } + notify_prepare(*readsetp); /* * If we have buffered packet data going to the client, mark that @@ -278,6 +319,8 @@ error("select: %.100s", strerror(e...