Commit bd5f5413 authored by aTc's avatar aTc

Merge branch 'master' of https://github.com/slaeshjag/dbp into upstream

parents 07f95bed e6460daf
......@@ -32,3 +32,14 @@ keys in, for per-application use.
* Maintainer Doesn't really make sense for per-application, but the DBP-system doesn't care about it anyway
* Version Probably useful for versioning packages. Maybe that the DBP-system should keep track of this value? Should probably decide on a version format too. Either that, or I should make a libdbp that exposes all package information.
### Code style for contributors
Code style is not that strict, although I prefer that it's kept consistent.
Indentation to be done with tabs (8 wide.)
Opening curly brackers should be placed on the same line as the scope declaration. Spaces between
function names/keywords and parathesis is optional. Spaces inside parenthesis is discouraged.
Function names are snake case, defines and enum values are all caps snake case. Types (structs, enum types)
are CamelCase. Variable names and labels are snake case.
The recommended background music while hacking is doom/gothic metal, eg. Katatonia. That's
the kind of general mood I'm in whenever I work on this anyway...
......@@ -158,7 +158,7 @@ void *comm_dbus_loop(void *n) {
if (!dbus_connection_register_object_path(dc, DBP_DBUS_DAEMON_OBJECT, &vt, p))
fprintf(dbp_error_log, "Unable to register object path\n");
dbus_conn_handle = dc;
while (dbus_connection_read_write_dispatch (dc, 50)) {
while (dbus_connection_read_write_dispatch (dc, 400)) {
if (should_die) {
/* Flush out the buffers */
dbus_connection_read_write_dispatch(dc, 10);
......
......@@ -84,7 +84,7 @@ void *mountwatch_loop(void *null) {
to = get_timeout();
FD_ZERO(&watch);
FD_SET(mountfd, &watch);
if (select(mountfd + 1, NULL, NULL, &watch, &to) >= 0)
if (select(mountfd + 1, NULL, NULL, &watch, &to) > 0)
sem_post(&mountwatch_struct.changed);
}
}
......@@ -275,7 +275,6 @@ struct mountwatch_change_s mountwatch_diff() {
return change;
}
while (!feof(fp)) {
*mount = *device = *fstype = 0;
fscanf(fp, "%256s %256s %128s\n", device, mount, fstype);
......
......@@ -122,9 +122,8 @@ static int package_id_lookup(struct package_s *p, const char *pkg_id) {
/* If basename(3) didn't suck, this function wouldn't be needed */
static const char *find_filename(const char *path) {
char *tmp = (char *) path;
while (strchr(tmp, '/') && (tmp = strchr(path, '/') + 1));
return tmp;
char *tmp;
return (tmp = strrchr(path, '/')) ? tmp + 1 : path;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment