summaryrefslogtreecommitdiffstats
path: root/omusrmsg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-23 06:21:16 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-23 06:21:16 +0000
commit8425445c2dd68d91bb62487032151f06d35c583a (patch)
tree92ef23fb997666d1b09ed65bb788c52dffc1c925 /omusrmsg.c
parent6b24fa20d4da8a57a2e34b1ca0c3159b93157e1e (diff)
downloadrsyslog-8425445c2dd68d91bb62487032151f06d35c583a.zip
rsyslog-8425445c2dd68d91bb62487032151f06d35c583a.tar.gz
rsyslog-8425445c2dd68d91bb62487032151f06d35c583a.tar.xz
simplified action calling using new interface Warning: this version has a
structure alignment issue in omusrmsg.c, I currently do not know why. I check in so that others can look at it.
Diffstat (limited to 'omusrmsg.c')
-rw-r--r--omusrmsg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/omusrmsg.c b/omusrmsg.c
index 3ac974a..f03a080 100644
--- a/omusrmsg.c
+++ b/omusrmsg.c
@@ -120,6 +120,8 @@ static void wallmsg(register selector_t *f)
return;
iovCreate(f); /* init the iovec */
+printf("gen iIovUsed %d\n", f->f_iIovUsed);
+printf("iovUsed address: %x, size %d\n",&f->f_iIovUsed, sizeof(selector_t));
/* open the user login file */
setutent();
@@ -179,13 +181,20 @@ static void wallmsg(register selector_t *f)
(void) signal(SIGALRM, endtty);
(void) alarm(15);
/* open the terminal */
+//errno = 0;
ttyf = open(p, O_WRONLY|O_NOCTTY);
+printf("try tty '%s' open: %d\n", p, ttyf);
if (ttyf >= 0) {
+printf("tty open!\n");
struct stat statb;
if (fstat(ttyf, &statb) == 0 &&
- (statb.st_mode & S_IWRITE))
- (void) writev(ttyf, f->f_iov, f->f_iIovUsed);
+ (statb.st_mode & S_IWRITE)) {
+int written;
+ // (void) writev(ttyf, f->f_iov, f->f_iIovUsed);
+ written = writev(ttyf, f->f_iov, f->f_iIovUsed);
+printf("write tty %d bytes, iIovUsed %d\n", written, f->f_iIovUsed);
+ }
close(ttyf);
ttyf = -1;
}