Displaying 20 results from an estimated 44 matches for "saved_errno".
2013 Sep 13
0
[LLVMdev] [RFC] New function attributes for errno-setting functions
...;s really getting stored in
"var", but it may be unreliable (i.e. not detect all cases).
I thought a bit more about it and I think we will need to have this
information to prevent similar problems as the one you mentioned in the
first post. For example:
int fd = open(...);
int saved_errno = errno;
double s = sqrt(var);
if (fd == -1)
fprintf(stderr, "error: %d\n", saved_errno);
With only the information about modifying errno, this code could be
transformed to
int fd = open(...);
double s = sqrt(var);
int saved_errno = errno;
if (fd == -1)
fpr...
2016 Apr 23
2
StreamLocal forwarding
...t;
>From this, it appears that there is no attempt to unlink the socket if
it already exists, as would be expected from this code
(https://github.com/openssh/openssh-portable/blob/7de4b03a6e4071d454b72927ffaf52949fa34545/misc.c#L1083):
sock = socket(PF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
saved_errno = errno;
error("socket: %.100s", strerror(errno));
errno = saved_errno;
return -1;
}
if (unlink_first == 1) {
if (unlink(path) != 0 && errno != ENOENT)
error("unlink(%s): %.100s", path, strerror(errno));
}
if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr))...
2013 Sep 13
2
[LLVMdev] [RFC] New function attributes for errno-setting functions
----- Original Message -----
> On 9/12/2013 7:44 PM, Hal Finkel wrote:
> >
> > To fix this problem, I think that we need to stop treating errno as
> > some arbitrary external state, and model is explicitly.
>
> In such case it would make sense to know when "errno" is read. This
> way
> we could detect whether it's actually used, whether or not the
2017 Jan 27
2
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...sm which
preserves errno.
However you'll need to save errno around caml_enter_blocking_section
since that unblocks and processes signals.
IOW:
static int
pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset)
{
CAMLparam0 ();
CAMLlocal3 (rv, strv, offsetv);
+ int saved_errno;
...
rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv);
+ saved_errno = errno;
if (Is_exception_result (rv)) {
nbdkit_error ("%s", caml_format_exception (Extract_exception (rv)));
caml_enter_blocking_section ();
+ errno = saved_errno;
CAMLretu...
2013 Sep 13
2
[LLVMdev] [RFC] New function attributes for errno-setting functions
...", but it may be unreliable (i.e. not detect all cases).
>
> I thought a bit more about it and I think we will need to have this
> information to prevent similar problems as the one you mentioned in
> the
> first post. For example:
>
> int fd = open(...);
> int saved_errno = errno;
> double s = sqrt(var);
> if (fd == -1)
> fprintf(stderr, "error: %d\n", saved_errno);
>
>
> With only the information about modifying errno, this code could be
> transformed to
>
> int fd = open(...);
> double s = sqrt(var);
>...
2016 May 03
2
StreamLocal forwarding
...t; > it already exists, as would be expected from this code
> > (
> > https://github.com/openssh/openssh-portable/blob/7de4b03a6e4071d454b72927ffaf52949fa34545/misc.c#L1083
> > ):
> >
> > sock = socket(PF_UNIX, SOCK_STREAM, 0);
> > if (sock < 0) {
> > saved_errno = errno;
> > error("socket: %.100s", strerror(errno));
> > errno = saved_errno;
> > return -1;
> > }
> > if (unlink_first == 1) {
> > if (unlink(path) != 0 && errno != ENOENT)
> > error("unlink(%s): %.100s", path, strerror(errno)...
2024 Jun 10
2
4.20: case (in)sensitive is broken
...ks.c
@@ -383,8 +383,14 @@ static int widelinks_openat(vfs_handle_struct *handle,
}
lstat_ret = SMB_VFS_NEXT_LSTAT(handle,
full_fname);
- if (lstat_ret != -1 &&
- VALID_STAT(full_fname->st) &&
+ if (lstat_ret == -1) {
+ /* Can't be a DFS link. */
+ int saved_errno = errno;
+ TALLOC_FREE(full_fname);
+ errno = saved_errno;
+ return -1;
+ }
+ if (VALID_STAT(full_fname->st) &&
S_ISLNK(full_fname->st.st_ex_mode)) {
fsp->fsp_name->st = full_fname->st;
}
2017 Jan 27
0
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...to save errno around caml_enter_blocking_section
> since that unblocks and processes signals.
>
> IOW:
>
> static int
> pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset)
> {
> CAMLparam0 ();
> CAMLlocal3 (rv, strv, offsetv);
> + int saved_errno;
> ...
> rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv);
> + saved_errno = errno;
> if (Is_exception_result (rv)) {
> nbdkit_error ("%s", caml_format_exception (Extract_exception (rv)));
> caml_enter_blocking_section ();
> +...
2012 May 07
0
Solved problem with hard links and schg flag under FreeBSD
...int do_link(const char *fname1, const char *fname2)
{
if (dry_run) return 0;
RETURN_ERROR_IF_RO_OR_LO;
if (link(fname1, fname2) == 0)
return 0;
#ifdef SUPPORT_FORCE_CHANGE
if (force_change && (errno == EPERM || errno == EACCES)) {
char parent[MAXPATHLEN];
int parent_flags;
int saved_errno = errno;
int file_flags = make_mutable(fname1, NULL, NO_FFLAGS, force_change);
if (file_flags) {
int ret = link(fname1, fname2);
undo_make_mutable(fname1, file_flags);
if (ret == 0)
return 0;
}
parent_flags = make_parentdir_mutable(fname2, force_change, parent, sizeof pa...
2007 Apr 18
1
[Bridge] Little problem with 1.x versions (if_indextoname)
Hi,
I have used bridge-utils 0.9.6 so far in a kernel 2.4.26, uClibc and ppc environment.
When I use version 1.0.3 I have the problem that I do not see the brige with the 'brctl show' command if it is not fully set up. It was working with 0.9.6.
I tracked the problem down to an 'incompatibility' in bridge/uClibc/kernel.
0.9.6 uses its own if_indextoname function which uses the
2016 Mar 08
1
[PATCH] fish: reset the console on ^Z RHBZ#1213844
Patch registers SIGTSTP hook where it sends reset terminal color
control sequence using write and fsync.
Handler is installed only if signal is not being ignored.
Patch uses rl_free_line_state and rl_cleanup_after_signal to unhook
readline from terminal, then it calls original TSTP handler using
approach in URL below and again hooks readline using
rl_reset_after_signal.
Handling is based on code
2013 Sep 13
0
[LLVMdev] [RFC] New function attributes for errno-setting functions
..., then it should potentially alias whatever the errno macro actually expands to (whether it is a global variable, and thread-local variable, a function call, or whatever).
I'm not sure about this. How about this:
extern int BLAH;
#define errno BLAH
Then we have
int fd = open(...);
int saved_errno = BLAH;
double s = sqrt(var);
If "sqrt" is "write-only-errno", how would we know that BLAH should be
aliased with sqrt? We don't to alias it with every global variable
(that's what this proposal is trying to address). We'd need a way to
associate BLAH with e...
2024 Jun 11
1
4.20: case (in)sensitive is broken
...t; ???????? lstat_ret = SMB_VFS_NEXT_LSTAT(handle,
> ???????????????? full_fname);
> -??????? if (lstat_ret != -1 &&
> -??????????? VALID_STAT(full_fname->st) &&
> +??????? if (lstat_ret == -1) {
> +??????????? /* Can't be a DFS link. */
> +??????????? int saved_errno = errno;
> +??????????? TALLOC_FREE(full_fname);
> +??????????? errno = saved_errno;
Can TALLOC_FREE change errno?
> +??????????? return -1;
> +??????? }
> +??????? if (VALID_STAT(full_fname->st) &&
> ???????????? S_ISLNK(full_fname->st.st_ex_mode)) {
> ??????...
2019 Jan 14
6
[PATCH nbdkit incomplete 0/5] Port to Windows.
This is an incomplete port to Windows. Currently the server compiles
and starts up successfully, but goes into an infinite loop when you
connect to it. Nevertheless I think the approach is ready for
feedback. This being Windows the changes go quite deep.
Rich.
2017 Apr 27
4
[PATCH 0/4] common: Add a simple mini-library for handling qemu command and config files.
Currently we have an OCaml library for generating the qemu command
line (used only by ‘virt-v2v -o qemu’). However we also generate a
qemu command line in ‘lib/launch-direct.c’, and we might in future
need to generate a ‘-readconfig’-compatible configuration file if we
want to go beyond 10,000 drives for scalability testing.
Therefore this patch series reimplements the qemu command line code as
2024 Jun 07
1
4.20: case (in)sensitive is broken
07.06.2024 20:52, Jeremy Allison wrote:
> Fair enough. Can you post a minimal smb.conf and directory
> setup that reproduces the problem and how to demo it with smbclient
> command lines please ? I know I'm asking to be spoon-fed but my time for
> Samba these days is quite limited and this would aid immensely
> in creating a properly tested fix.
You're not asking to be
2023 Jun 17
2
[PATCH] ssh-agent: add systemd socket-based activation
...id)
return;
+#ifdef WITH_SYSTEMD
+ if (external_socket)
+ return;
+#endif
debug_f("cleanup");
if (socket_name[0])
unlink(socket_name);
@@ -2000,7 +2012,7 @@ int
main(int ac, char **av)
{
int c_flag = 0, d_flag = 0, D_flag = 0, k_flag = 0, s_flag = 0;
- int sock, ch, result, saved_errno;
+ int sock = 0, ch, result, saved_errno;
char *shell, *format, *pidstr, *agentsocket = NULL;
#ifdef HAVE_SETRLIMIT
struct rlimit rlim;
@@ -2015,6 +2027,9 @@ main(int ac, char **av)
struct pollfd *pfd = NULL;
size_t npfd = 0;
u_int maxfds;
+#ifdef WITH_SYSTEMD
+ int nfds = 0;
+#endif...
2016 Oct 05
3
Socket forwarding with non existent remote directories
Hi openssh dev's,
I love an truly appreciate the Socket forwarding feature in OpenSSH 6.7.
i use it for forwarding the socket of GnuPG's agent
(that handles the secret stuff) to remote machines.
Usecase:
======
I am a remote worker and use gnupg agent forwarding
to connect to our company infrastructure that makes heavy use
of PGP encryption while keeping my key out of the hands of
2013 Feb 19
13
[PATCH] mini-os: implement poll(2)
It is just a wrapper around select(2).
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
extras/mini-os/include/posix/poll.h | 1 +
extras/mini-os/lib/sys.c | 90 ++++++++++++++++++++++++++++++++++-
2 files changed, 90 insertions(+), 1 deletion(-)
create mode 100644 extras/mini-os/include/posix/poll.h
diff --git a/extras/mini-os/include/posix/poll.h
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky
for development (too easy to miss new ones) so I spent some
time last week and today working on removing them.
The first patch gets us down to almost no warnings with
the original -Wall setting. That was by far the hardest part.
Once I'd done that, I enabled nearly all of gcc's warnings via
gnulib's warnings and manywarnings modules