summaryrefslogtreecommitdiff
path: root/libjack/unlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'libjack/unlock.c')
-rw-r--r--libjack/unlock.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libjack/unlock.c b/libjack/unlock.c
index fc04278..9c1a37e 100644
--- a/libjack/unlock.c
+++ b/libjack/unlock.c
@@ -1,22 +1,22 @@
/* -*- mode: c; c-file-style: "bsd"; -*- */
/*
Copyright (C) 2004 Paul Davis
-
+
This program 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.1 of the License, or
(at your option) any later version.
-
+
This program 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 Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
+ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
+ */
#include <stdio.h>
#include <unistd.h>
@@ -46,8 +46,8 @@ static char* library_roots[] = {
"/usr/lib",
"/usr/local/lib",
"/usr/X11R6/lib",
- "/opt/lib", /* solaris-y */
- "/opt/local/lib", /* common on OS X */
+ "/opt/lib", /* solaris-y */
+ "/opt/local/lib", /* common on OS X */
NULL
};
@@ -57,13 +57,13 @@ cleanup_mlock ()
FILE* map;
size_t start;
size_t end;
- char path[PATH_MAX+1];
+ char path[PATH_MAX + 1];
int unlock;
int i;
int whoknows;
int looks_like_library;
- snprintf (path, sizeof(path), "/proc/%d/maps", getpid());
+ snprintf (path, sizeof(path), "/proc/%d/maps", getpid ());
if ((map = fopen (path, "r")) == NULL) {
jack_error ("can't open map file");
@@ -98,7 +98,7 @@ cleanup_mlock ()
if (!looks_like_library) {
continue;
}
-
+
for (i = 0; blacklist[i]; ++i) {
if (strstr (path, blacklist[i])) {
unlock = 1;
@@ -109,21 +109,21 @@ cleanup_mlock ()
if (end - start > 1048576) {
unlock = 1;
}
-
+
for (i = 0; whitelist[i]; ++i) {
if (strstr (path, whitelist[i])) {
unlock = 0;
break;
}
}
-
+
if (unlock) {
jack_info ("unlocking %s", path);
- munlock ((char *) start, end - start);
+ munlock ((char*)start, end - start);
}
}
fclose (map);
}
-
-
+
+