Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
41cba1cc
Commit
41cba1cc
authored
Sep 11, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Log): доделал утилиту log-wrap для "чтения" cerr и cout
parent
0217b4b1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
9 deletions
+7
-9
Makefile.am
Utilities/ULog/Makefile.am
+2
-2
log-stdin.cc
Utilities/ULog/log-stdin.cc
+1
-1
log-wrap.cc
Utilities/ULog/log-wrap.cc
+4
-6
logserver.cc
Utilities/ULog/logserver.cc
+0
-0
No files found.
Utilities/ULog/Makefile.am
View file @
41cba1cc
bin_PROGRAMS
=
@PACKAGE@-log
@PACKAGE@-log-stdin
@PACKAGE@-logserver-wrap
noinst_PROGRAMS
=
@PACKAGE@-test-logserver
bin_PROGRAMS
=
@PACKAGE@-log @PACKAGE@-logserver-wrap
noinst_PROGRAMS
=
@PACKAGE@-test-logserver
@PACKAGE@-log-stdin
@PACKAGE@
_test_logserver_SOURCES
=
logserver.cc
@PACKAGE@
_test_logserver_LDADD
=
$(top_builddir)
/lib/libUniSet2.la
$(COMCPP_LIBS)
...
...
Utilities/ULog/log-stdin.cc
View file @
41cba1cc
...
...
@@ -74,7 +74,7 @@ int main( int argc, char* argv[], char* envp[] )
while
(
true
)
{
size_t
r
=
read
(
0
,
buf
,
sizeof
(
buf
)
-
1
);
size_t
r
=
read
(
fileno
(
stdin
)
,
buf
,
sizeof
(
buf
)
-
1
);
if
(
r
>
0
)
{
buf
[
r
]
=
'\0'
;
...
...
Utilities/ULog/log-wrap.cc
View file @
41cba1cc
...
...
@@ -43,7 +43,6 @@ int main( int argc, char* argv[], char* envp[] )
try
{
/* Create a child to run command. */
switch
(
pid
=
fork
()
)
{
case
-
1
:
...
...
@@ -57,11 +56,11 @@ int main( int argc, char* argv[], char* envp[] )
/* Child. */
close
(
cp
[
0
]);
close
(
fileno
(
stderr
)
);
//close stderr
dup2
(
fileno
(
stdout
),
fileno
(
stderr
));
close
(
fileno
(
stdout
)
);
dup2
(
cp
[
1
],
fileno
(
stdout
));
close
(
fileno
(
stdout
));
/* Close current stdout. */
dup2
(
cp
[
1
],
fileno
(
stdout
));
/* Make stdout go to write end of pipe. */
close
(
fileno
(
stderr
)
);
dup2
(
fileno
(
stdout
),
fileno
(
stderr
));
execvpe
(
argv
[
3
],
argv
+
3
,
envp
);
perror
(
"No exec"
);
...
...
@@ -90,7 +89,6 @@ int main( int argc, char* argv[], char* envp[] )
ssize_t
r
=
read
(
cp
[
0
],
&
buf
,
sizeof
(
buf
)
-
1
);
if
(
r
>
0
)
{
cout
<<
"***READ**"
<<
endl
;
buf
[
r
]
=
'\0'
;
zlog
<<
buf
;
}
...
...
Utilities/ULog/logserver.cc
View file @
41cba1cc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment