Small portion of FreeBSD fixes:
authorRoman Bogorodskiy <mirrorbox@users.sourceforge.net>
Sat, 3 May 2008 12:30:05 +0000 (12:30 +0000)
committerRoman Bogorodskiy <mirrorbox@users.sourceforge.net>
Sat, 3 May 2008 12:30:05 +0000 (12:30 +0000)
- diskio.c is not needed for freebsd
- sync cpu freq related functions prototypes
- cleanup #indef's

It still doesn't compile on FreeBSD though.

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1117 7f574dfc-610e-0410-a909-a81674777703

src/Makefile.am
src/conky.c
src/freebsd.c

index 958e03c..f85e8ee 100644 (file)
@@ -55,7 +55,7 @@ endif
 #endif
 
 if BUILD_FREEBSD
-freebsd = freebsd.c diskio.c
+freebsd = freebsd.c
 PTHREAD_LIBS =  -pthread
 endif
 
index f38c6f5..b8b3b36 100644 (file)
@@ -3583,9 +3583,11 @@ static struct text_object *construct_text_object(const char *s,
        END OBJ(user_times, INFO_USERS)
        END OBJ(user_terms, INFO_USERS)
        END OBJ(user_number, INFO_USERS)
+#if defined(__linux__)
        END OBJ(gw_iface, INFO_GW)
        END OBJ(gw_ip, INFO_GW)
        END OBJ(if_gw, INFO_GW)
+#endif /* !__linux__ */
 #ifndef __OpenBSD__
        END OBJ(adt746xcpu, 0)
        END OBJ(adt746xfan, 0)
@@ -5439,9 +5441,11 @@ static void generate_text_internal(char *p, int p_max_size,
                                        if_jumped = 0;
                                }
                        }
+#if defined(__linux__)
                        OBJ(ioscheduler) {
                                snprintf(p, p_max_size, "%s", get_ioscheduler(obj->data.s));
                        }
+#endif
                        OBJ(kernel) {
                                snprintf(p, p_max_size, "%s", cur->uname_s.release);
                        }
index 63d25a7..b81ba75 100644 (file)
@@ -519,7 +519,7 @@ __inline__ unsigned long long int rdtsc()
 
 /* return system frequency in MHz (use divisor=1) or GHz (use divisor=1000) */
 void get_freq_dynamic(char *p_client_buffer, size_t client_buffer_size,
-               char *p_format, int divisor)
+               const char *p_format, int divisor)
 {
 #if  defined(__i386) || defined(__x86_64)
        struct timezone tz;
@@ -549,7 +549,7 @@ void get_freq_dynamic(char *p_client_buffer, size_t client_buffer_size,
 }
 
 /* void */
-char get_freq(char *p_client_buffer, size_t client_buffer_size, char *p_format,
+char get_freq(char *p_client_buffer, size_t client_buffer_size, const char *p_format,
                int divisor, unsigned int cpu)
 {
        int freq;