1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
Author: Tj <debian@iam.tj>
Last-Update: 2025-10-28
Forwarded: no
Description: Fix rename log log2 functions
--- a/w3cam.c
+++ b/w3cam.c
@@ -121,7 +121,7 @@ usage (char *pname, int width, int heigh
/*
*/
void
-log (char *info)
+__log (char *info)
{
#ifdef USE_SYSLOG
syslog (LOG_USER, "%s\n", info);
@@ -133,7 +133,7 @@ log (char *info)
/*
*/
void
-log2 (char *s1, char *s2)
+__log2 (char *s1, char *s2)
{
#ifdef USE_SYSLOG
syslog (LOG_USER, "%s %s\n", s1, s2);
@@ -195,7 +195,7 @@ get_image (int dev, int width, int heigh
if (input == IN_TV) {
if (freq > 0) {
if (ioctl (dev, VIDIOCSFREQ, &freq) == -1)
- log2 ("ioctl (VIDIOCSREQ):", strerror(errno));
+ __log2 ("ioctl (VIDIOCSREQ):", strerror(errno));
}
}
@@ -223,7 +223,7 @@ get_image (int dev, int width, int heigh
vid_win.width = width;
vid_win.height = height;
if (ioctl (dev, VIDIOCSWIN, &vid_win) == -1) {
- log2 ("ioctl(VIDIOCSWIN):", strerror(errno));
+ __log2 ("ioctl(VIDIOCSWIN):", strerror(errno));
return (NULL);
}
}
@@ -254,19 +254,19 @@ get_image (int dev, int width, int heigh
map = mmap (0, vid_buf.size, PROT_READ|PROT_WRITE,MAP_SHARED,dev,0);
if ((unsigned char *)-1 == (unsigned char *)map) {
- log2 ("mmap():", strerror(errno));
+ __log2 ("mmap():", strerror(errno));
return (NULL);
}
vid_mmap.frame = 0;
vid_mmap.width = width;
vid_mmap.height =height;
if (ioctl (dev, VIDIOCMCAPTURE, &vid_mmap) == -1) {
- log2 ("ioctl(VIDIOCMCAPTURE):", strerror(errno));
+ __log2 ("ioctl(VIDIOCMCAPTURE):", strerror(errno));
munmap (map, vid_buf.size);
return (NULL);
}
if (ioctl (dev, VIDIOCSYNC, &vid_mmap.frame) == -1) {
- log2 ("ioctl(VIDIOCSYNC):", strerror(errno));
+ __log2 ("ioctl(VIDIOCSYNC):", strerror(errno));
munmap (map, vid_buf.size);
return (NULL);
}
@@ -617,10 +617,10 @@ main (int argc, char *argv[])
#endif
cgi_init (argv[0]);
if (signal (SIGTERM, on_signal) == SIG_ERR) {
- log ("couldn't register handler for SIGTERM");
+ __log ("couldn't register handler for SIGTERM");
}
if (signal (SIGPIPE, on_signal) == SIG_ERR) {
- log ("couldn't register handler for SIGPIPE");
+ __log ("couldn't register handler for SIGPIPE");
}
/* check some values from the config file
*/
@@ -805,7 +805,7 @@ main (int argc, char *argv[])
mime = "image/png";
break;
default:
- log ("unknown image format..!?");
+ __log ("unknown image format..!?");
break;
}
#ifdef HAVE_LIBTTF
@@ -830,7 +830,7 @@ again:
while (max_try) {
dev = open (device, O_RDWR);
if (dev == -1) {
- log2 (device, strerror(errno));
+ __log2 (device, strerror(errno));
if (!--max_try) {
cgi_response (http_ok, "text/plain");
printf ("Can't open device %s: %s\n",device,strerror(errno));
|