Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
喜羊羊3508
Dak
提交
9fdf31a9
D
Dak
项目概览
喜羊羊3508
/
Dak
12 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Dak
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9fdf31a9
编写于
12月 06, 2012
作者:
A
Ansgar Burchardt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debianqueued: use three argument form of open() in most places
上级
d3b91e7e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
17 deletion
+17
-17
tools/debianqueued-0.9/debianqueued
tools/debianqueued-0.9/debianqueued
+17
-17
未找到文件。
tools/debianqueued-0.9/debianqueued
浏览文件 @
9fdf31a9
...
...
@@ -82,7 +82,7 @@ if ( @ARGV == 1 && $ARGV[0] =~ /^-[rk]$/ ) {
#
test
for
another
instance
of
the
queued
already
running
my
(
$
pid
,
$
delayed_dirs
,
$
adelayedcore
);
if
(
open
(
PIDFILE
,
"<
$conf::pidfile"
)
)
{
if
(
open
(
PIDFILE
,
"<
"
,
$
conf
::
pidfile
)
)
{
chomp
(
$
pid
=
<
PIDFILE
>
);
close
(
PIDFILE
);
if
(
!$pid ) {
...
...
@@ -318,7 +318,7 @@ chdir($conf::incoming)
$
SIG
{
"HUP"
}
=
"IGNORE"
;
#
open
logfile
,
make
it
unbuffered
open
(
LOG
,
">>
$conf::logfile"
)
open
(
LOG
,
">>
"
,
$
conf
::
logfile
)
or
die
"Cannot open my logfile $conf::logfile: $!
\n
"
;
chmod
(
0644
,
$
conf
::
logfile
)
or
die
"Cannot set modes of $conf::logfile: $!
\n
"
;
...
...
@@ -328,11 +328,11 @@ sleep(1);
$
SIG
{
"HUP"
}
=
\&
close_log
;
#
redirect
stdin
,
...
to
/
dev
/
null
open
(
STDIN
,
"</dev/null"
)
open
(
STDIN
,
"<
"
,
"
/dev/null"
)
or
die
"$main::progname: Can't redirect stdin to /dev/null: $!
\n
"
;
open
(
STDOUT
,
">&
LOG"
)
open
(
STDOUT
,
">&
"
,
\*
LOG
)
or
die
"$main::progname: Can't redirect stdout to $conf::logfile: $!
\n
"
;
open
(
STDERR
,
">&
LOG"
)
open
(
STDERR
,
">&
"
,
\*
LOG
)
or
die
"$main::progname: Can't redirect stderr to $conf::logfile: $!
\n
"
;
#
ok
,
from
this
point
usually
no
"die"
anymore
,
stderr
is
gone
!
...
...
@@ -360,7 +360,7 @@ END {
}
#
write
the
pid
file
open
(
PIDFILE
,
">
$conf::pidfile"
)
open
(
PIDFILE
,
">
"
,
$
conf
::
pidfile
)
or
msg
(
"log"
,
"Can't open $conf::pidfile: $!
\n
"
);
printf
PIDFILE
"%5d
\n
"
,
$$;
close
(
PIDFILE
);
...
...
@@ -591,7 +591,7 @@ sub get_filelist_from_known_good_changes($) {
my (@filenames);
# parse the .changes file
open( CHANGES, "<
$changes"
)
open( CHANGES, "<
", $changes
)
or die "$changes: $!\n";
outer_loop: while (<CHANGES>) {
if (/^Files:/i) {
...
...
@@ -639,7 +639,7 @@ sub process_changes($\@) {
msg( "log", "processing ${main::current_incoming_short}/$changes\n" );
# parse the .changes file
open( CHANGES, "<
$changes"
)
open( CHANGES, "<
", $changes
)
or die "Cannot open ${main::current_incoming_short}/$changes: $!\n";
$pgplines = 0;
$extralines = 0;
...
...
@@ -790,7 +790,7 @@ outer_loop: while (<CHANGES>) {
$failure_file = $changes . "
.
failures
";
$retries = $last_retry = 0;
if ( -f $failure_file ) {
open( FAILS, "
<
$
failure_file
"
)
open( FAILS, "
<
", $failure_file
)
or die "
Cannot
open
$
main
::
current_incoming_short
/$
failure_file
:
$
!\n";
my
$
line
=
<
FAILS
>;
close
(
FAILS
);
...
...
@@ -987,7 +987,7 @@ outer_loop: while (<CHANGES>) {
rm
(
$
changes
,
@
filenames
,
$
failure_file
);
}
else
{
$
last_retry
=
time
;
if
(
open
(
FAILS
,
">
$failure_file"
)
)
{
if
(
open
(
FAILS
,
">
"
,
$
failure_file
)
)
{
print
FAILS
"$retries $last_retry
\n
"
;
close
(
FAILS
);
chmod
(
0600
,
$
failure_file
)
...
...
@@ -1113,7 +1113,7 @@ sub process_commands($) {
msg
(
"log"
,
"processing $main::current_incoming_short/$commands
\n
"
);
#
parse
the
.
commands
file
if
(
!open( COMMANDS, "<
$commands"
) ) {
if
(
!open( COMMANDS, "<
", $commands
) ) {
msg
(
"log"
,
"Cannot open $main::current_incoming_short/$commands: $!
\n
"
);
return
;
}
...
...
@@ -1730,7 +1730,7 @@ sub fork_statusd() {
# open the FIFO for writing; this blocks until someone (probably ftpd)
# opens it for reading
open( STATFIFO, ">
$conf::statusfile"
)
open( STATFIFO, ">
", $conf::statusfile
)
or die "Cannot open $conf::statusfile\n";
select(STATFIFO);
...
...
@@ -1776,7 +1776,7 @@ sub write_status_file() {
return if !$conf::statusfile;
open( STATFILE, ">
$conf::statusfile"
)
open( STATFILE, ">
", $conf::statusfile
)
or ( msg( "log", "Could not open $conf::statusfile: $!\n" ), return );
my $oldsel = select(STATFILE);
...
...
@@ -2083,7 +2083,7 @@ sub check_incoming_writable() {
my $file = "junk-for-writable-test-" . format_time();
$file =~ s/[ :.]/-/g;
local (*F);
open( F, ">
$file"
);
open( F, ">
", $file
);
close(F);
my $rv;
( $rv, $msg ) = ftp_cmd( "put", $file );
...
...
@@ -2370,16 +2370,16 @@ sub close_log($) {
close(STDOUT);
close(STDERR);
open( LOG, ">>
$conf::logfile"
)
open( LOG, ">>
", $conf::logfile
)
or die "Cannot open my logfile $conf::logfile: $!\n";
chmod( 0644, $conf::logfile )
or msg( "log", "Cannot set modes of $conf::logfile: $!\n" );
select( ( select(LOG), $| = 1 )[0] );
open( STDOUT, ">&
LOG"
)
open( STDOUT, ">&
", \*LOG
)
or msg( "log",
"$main::progname: Can'
t
redirect
stdout
to
" . "
$
conf
::
logfile
:
$
!\n" );
open
(
STDERR
,
">&
LOG"
)
open
(
STDERR
,
">&
"
,
\*
LOG
)
or
msg
(
"log"
,
"$main::progname: Can't redirect stderr to "
.
"$conf::logfile: $!
\n
"
);
msg
(
"log"
,
"Restart after SIGHUP
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录