]> code.delx.au - pulseaudio/blobdiff - polyp/cpulimit.c
Merge Pierre's changes
[pulseaudio] / polyp / cpulimit.c
index 78dc5e1fd53e3e0142ced8a408864a5a2b917f93..53920f50a8d8f5f3c649d713a6d37efa11979ba7 100644 (file)
@@ -4,30 +4,39 @@
   This file is part of polypaudio.
  
   polypaudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2 of the License,
-  or (at your option) any later version.
+  it under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
  
   polypaudio is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
  
-  You should have received a copy of the GNU Lesser General Public License
-  along with polypaudio; if not, write to the Free Software
+  You should have received a copy of the GNU Lesser General Public
+  License along with polypaudio; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
 ***/
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_SIGXCPU
+
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 #include <sys/time.h>
-#include <sys/resource.h>
 #include <unistd.h>
 #include <signal.h>
 
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
 #include "cpulimit.h"
 #include "util.h"
 #include "log.h"
@@ -215,3 +224,16 @@ void pa_cpu_limit_done(void) {
         installed = 0;
     }
 }
+
+#else /* HAVE_SIGXCPU */
+
+struct pa_mainloop_api;
+
+int pa_cpu_limit_init(struct pa_mainloop_api *m) {
+    return 0;
+}
+
+void pa_cpu_limit_done(void) {
+}
+
+#endif