Skip to content

Commit

Permalink
Revert "Solving problems while compiling jack2 on macOS X with dbus s…
Browse files Browse the repository at this point in the history
…upport (#434)"

Reduce code bloat by removing support of non-libre operating system

This reverts commit bb3f5cb.
  • Loading branch information
nedko committed Nov 18, 2023
1 parent caa739f commit b1ec487
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 51 deletions.
18 changes: 9 additions & 9 deletions dbus/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
#include <dbus/dbus.h>
#include <assert.h>
#include <unistd.h>
#include <sys/sysinfo.h>
#include <errno.h>

#include "controller.h"
#include "controller_internal.h"
#include "xml.h"
#include "reserve.h"
#include "uptime.h"

struct jack_dbus_interface_descriptor * g_jackcontroller_interfaces[] =
{
Expand Down Expand Up @@ -787,18 +787,18 @@ void
jack_controller_run(
void * context)
{
long ut;
struct sysinfo si;

if (controller_ptr->pending_save == 0)
{
return;
}

if ((ut = uptime()) < 0)
if (sysinfo(&si) != 0)
{
jack_error(UPTIME_FUNCTION_NAME "() failed with %d", errno);
jack_error("sysinfo() failed with %d", errno);
}
else if (ut < controller_ptr->pending_save + 2) /* delay save by two seconds */
else if (si.uptime < controller_ptr->pending_save + 2) /* delay save by two seconds */
{
return;
}
Expand All @@ -813,15 +813,15 @@ void
jack_controller_pending_save(
struct jack_controller * controller_ptr)
{
long ut;
struct sysinfo si;

if ((ut = uptime()) < 0)
if (sysinfo(&si) != 0)
{
jack_error(UPTIME_FUNCTION_NAME "() failed with %d.", errno);
jack_error("sysinfo() failed with %d.", errno);
controller_ptr->pending_save = 0;
jack_controller_settings_save_auto(controller_ptr);
return;
}

controller_ptr->pending_save = ut;
controller_ptr->pending_save = si.uptime;
}
3 changes: 0 additions & 3 deletions dbus/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ def build(bld):
'reserve.c',
]
obj.use = ['JACKSERVER']
obj.source += [
'../linux/uptime.c',
]
if bld.env['IS_LINUX']:
obj.use += ['PTHREAD', 'DL', 'RT', 'DBUS-1', 'EXPAT']
if bld.env['IS_FREEBSD']:
Expand Down
12 changes: 0 additions & 12 deletions linux/uptime.c

This file was deleted.

27 changes: 0 additions & 27 deletions linux/uptime.h

This file was deleted.

0 comments on commit b1ec487

Please sign in to comment.