On Thu, 11.07.13 19:18, Karol Lewandowski (k.lewando...@samsung.com) wrote:
> Add ability to test if given file contains specified value. > File and expected value are given as one argument separated > by colon (":"), i.e. > > ConditionFileContains=/sys/module/sn/parameters/enabled:1 Hmm, I don't like the naming. If this is called "Contains" I'd always assume that it does substring matching or so? Maybe ConditionFileContentsIs= or so? I don#t really like the : as separator. Either "=" or a space sounds better. > + path = strdup(parameter); > + if (!path) { > + log_oom(); > + return false; > + } > + > + p = strchr(path, ':'); > + if (!p) > + return false; > + > + *(p++) = '\0'; I'd prefer if we'd have a path_is_absolute() check here, and immeidately fail with a warning if the path isn't absolute. Lennart -- Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel