use Getopt::Long qw/:config posix_default no_ignore_case gnu_compat
bundling auto_version/;
use DBI ();
-use Fcntl qw/F_GETFL F_SETFL FD_CLOEXEC/;
+use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC/;
use List::Util 'first';
use lib 'lib';
open $LOGGER_FD, '>>', $CONF->{_}->{logfile}
or die "Can't open $CONF->{_}->{logfile}: $!\n";
$LOGGER_FD->autoflush(1);
- my $flags = fcntl($LOGGER_FD, F_GETFL, 0) or die "fcntl F_GETFL: $!";
- fcntl($LOGGER_FD, F_SETFL, $flags | FD_CLOEXEC) or die "fcntl F_SETFL: $!";
+ my $flags = fcntl($LOGGER_FD, F_GETFD, 0) or die "fcntl F_GETFD: $!";
+ fcntl($LOGGER_FD, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl F_SETFD: $!";
}
elsif ($CONFIG{debug}) {
$LOGGER_FD = \*STDERR;
use Compress::Raw::Zlib qw/Z_OK Z_FULL_FLUSH Z_SYNC_FLUSH MAX_WBITS/;
use Config::Tiny ();
use Errno 'EINTR';
-use Fcntl qw/F_GETFL F_SETFL FD_CLOEXEC/;
+use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC/;
use Net::SSLeay ();
use List::Util qw/all first/;
use POSIX ':signal_h';
next if $! == EINTR; # try again if connect(2) was interrupted by a signal
next SOCKETS;
}
- my $flags = fcntl($s, F_GETFL, 0) or $self->panic("fcntl F_GETFL: $!");
- fcntl($s, F_SETFL, $flags | FD_CLOEXEC) or $self->panic("fcntl F_SETFL: $!");
+ my $flags = fcntl($s, F_GETFD, 0) or $self->panic("fcntl F_GETFD: $!");
+ fcntl($s, F_SETFD, $flags | FD_CLOEXEC) or $self->panic("fcntl F_SETFD: $!");
return $s;
}
$self->fail("Can't connect to $host:$port");
my $NAME = 'pullimap';
use Errno 'EINTR';
-use Fcntl qw/O_CREAT O_RDWR O_DSYNC LOCK_EX SEEK_SET F_GETFL F_SETFL FD_CLOEXEC/;
+use Fcntl qw/O_CREAT O_RDWR O_DSYNC LOCK_EX SEEK_SET F_GETFD F_SETFD FD_CLOEXEC/;
use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version/;
use List::Util 'first';
use Socket qw/PF_INET PF_INET6 SOCK_STREAM/;
}
sysopen($STATE, $statefile, O_CREAT|O_RDWR|O_DSYNC, 0600) or die "Can't open $statefile: $!";
- my $flags = fcntl($STATE, F_GETFL, 0) or die "fcntl F_GETFL: $!";
- fcntl($STATE, F_SETFL, $flags | FD_CLOEXEC) or die "fcntl F_SETFL: $!";
+ my $flags = fcntl($STATE, F_GETFD, 0) or die "fcntl F_GETFD: $!";
+ fcntl($STATE, F_SETFD, $flags | FD_CLOEXEC) or die "fcntl F_SETFD: $!";
flock($STATE, LOCK_EX) or die "Can't flock $statefile: $!";
};