avoid clash with syslog openlog(3); fixes static linking

This commit is contained in:
naddy 2009-03-08 16:30:00 +00:00
parent a3e1a41274
commit 91fa649909
2 changed files with 64 additions and 10 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.16 2009/03/07 15:37:38 jasper Exp $
# $OpenBSD: Makefile,v 1.17 2009/03/08 16:30:00 naddy Exp $
COMMENT= tails a given file anywhere on your X11 root window
DISTNAME= root-tail-1.2
PKGNAME= ${DISTNAME}p0
PKGNAME= ${DISTNAME}p1
CATEGORIES= x11
HOMESITE= http://www.goof.com/pcg/marc

View File

@ -1,7 +1,16 @@
$OpenBSD: patch-root-tail_c,v 1.3 2005/12/20 19:01:26 pvalchev Exp $
--- root-tail.c.orig Tue Dec 20 11:21:46 2005
+++ root-tail.c Tue Dec 20 11:22:16 2005
@@ -235,7 +235,6 @@ find_root_window (Display *display, int
$OpenBSD: patch-root-tail_c,v 1.4 2009/03/08 16:30:00 naddy Exp $
--- root-tail.c.orig Fri Jul 30 21:33:20 2004
+++ root-tail.c Sun Mar 8 16:54:40 2009
@@ -167,7 +167,7 @@ void transform_line (char *s);
int lineinput (struct logfile_entry *);
void reopen (void);
void check_open_files (void);
-FILE *openlog (struct logfile_entry *);
+FILE *open_log (struct logfile_entry *);
static void main_loop (void);
void display_version (void);
@@ -235,7 +235,6 @@ find_root_window (Display *display, int screen_number)
{
Atom SWM_VROOT = XInternAtom (display, "__SWM_VROOT", False);
Atom NAUTILUS_DESKTOP_WINDOW_ID = XInternAtom (display, "NAUTILUS_DESKTOP_WINDOW_ID", False);
@ -9,12 +18,57 @@ $OpenBSD: patch-root-tail_c,v 1.3 2005/12/20 19:01:26 pvalchev Exp $
Window unused, *windows = 0;
unsigned int count;
@@ -244,6 +243,8 @@ find_root_window (Display *display, int
int format;
@@ -245,6 +244,8 @@ find_root_window (Display *display, int screen_number)
unsigned long nitems, bytes_after_return;
unsigned char *virtual_root_window;
+
+ root = RootWindow (display, screen_number);
+ root = RootWindow (display, screen_number);
+
if (XGetWindowProperty (display, root, NAUTILUS_DESKTOP_WINDOW_ID,
0, 1, False, XA_WINDOW, &type, &format,
&nitems, &bytes_after_return,
@@ -742,7 +743,7 @@ lineinput (struct logfile_entry *logfile)
* in case of error, file->fp is NULL
*/
FILE *
-openlog (struct logfile_entry * file)
+open_log (struct logfile_entry * file)
{
struct stat stats;
@@ -786,7 +787,7 @@ reopen (void)
if (e->fp)
fclose (e->fp);
/* if fp is NULL we will try again later */
- openlog (e);
+ open_log (e);
}
do_reopen = 0;
@@ -808,7 +809,7 @@ check_open_files (void)
sleep (1);
if (e->fp)
fclose (e->fp);
- if (openlog (e) == NULL)
+ if (open_log (e) == NULL)
continue;
if (fstat (fileno (e->fp), &stats) < 0)
continue;
@@ -818,7 +819,7 @@ check_open_files (void)
{ /* file renamed? */
if (e->fp)
fclose (e->fp);
- if (openlog (e) == NULL)
+ if (open_log (e) == NULL)
continue;
if (fstat (fileno (e->fp), &stats) < 0)
continue;
@@ -1418,7 +1419,7 @@ main (int argc, char *argv[])
{
e->fname = xstrdup (fname);
- if (openlog (e) == NULL)
+ if (open_log (e) == NULL)
perror (fname), exit (1);
e->desc = xstrdup (desc);