Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
S
scom
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
scom
Commits
aeb09298
Kaydet (Commit)
aeb09298
authored
Şub 21, 2006
tarafından
Gürer Özen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
daha informatif debug çıktısı
üst
32fc1163
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
log.c
comar/src/log.c
+16
-2
main.c
comar/src/main.c
+2
-2
No files found.
comar/src/log.c
Dosyayı görüntüle @
aeb09298
/*
** Copyright (c) 2005, TUBITAK/UEKAE
** Copyright (c) 2005
-2006
, TUBITAK/UEKAE
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
...
...
@@ -11,11 +11,13 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <time.h>
#include <sys/stat.h>
#include "cfg.h"
#include "log.h"
#include "process.h"
static
void
timestamp
(
FILE
*
f
)
...
...
@@ -30,11 +32,22 @@ timestamp(FILE *f)
fputs
(
buf
,
f
);
}
static
void
pidstamp
(
FILE
*
f
)
{
if
(
strlen
(
my_proc
.
desc
)
<=
5
)
fprintf
(
f
,
"(%s-%d) "
,
my_proc
.
desc
,
getpid
());
else
fprintf
(
f
,
"(%s-%d) "
,
my_proc
.
desc
+
5
,
getpid
());
}
static
void
log_print
(
const
char
*
fmt
,
va_list
ap
,
int
error
)
{
if
(
cfg_log_console
)
if
(
cfg_log_console
)
{
pidstamp
(
stdout
);
vprintf
(
fmt
,
ap
);
}
if
(
cfg_log_file
)
{
FILE
*
f
;
...
...
@@ -42,6 +55,7 @@ log_print(const char *fmt, va_list ap, int error)
f
=
fopen
(
cfg_log_file_name
,
"a"
);
if
(
f
)
{
timestamp
(
f
);
pidstamp
(
f
);
if
(
error
)
fprintf
(
f
,
"Error: "
);
vfprintf
(
f
,
fmt
,
ap
);
fclose
(
f
);
...
...
comar/src/main.c
Dosyayı görüntüle @
aeb09298
/*
** Copyright (c) 2005, TUBITAK/UEKAE
** Copyright (c) 2005
-2006
, TUBITAK/UEKAE
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
...
...
@@ -77,6 +77,7 @@ main(int argc, char *argv[])
puts
(
_
(
"This program is a system service and should not started by users."
));
exit
(
1
);
}
proc_init
();
log_start
();
// Shutdown old COMAR
...
...
@@ -85,7 +86,6 @@ main(int argc, char *argv[])
// Second phase: subsytem init
if
(
db_init
()
!=
0
)
return
1
;
proc_init
();
if
(
model_init
()
!=
0
)
return
1
;
// Third phase: helper processes
...
...
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