+ if (path_is_absolute(argv[i])) {
+ char *p = NULL;
+ const char *path;
+
+ p = canonicalize_file_name(argv[i]);
+ path = p ? p : argv[i];
+
+ if (stat(path, &st) < 0) {
+ free(p);
+ log_error("Couldn't stat file: %m");
+ r = -errno;
+ goto finish;
+ }
+
+ if (S_ISREG(st.st_mode) && (0111 & st.st_mode)) {
+ char *t;
+
+ t = strappend("_EXE=", path);
+ if (!t) {
+ free(p);
+ log_error("Out of memory");
+ goto finish;
+ }
+
+ r = sd_journal_add_match(j, t, strlen(t));
+ free(t);
+ } else {
+ free(p);
+ log_error("File is not a regular file or is not executable: %s", argv[i]);
+ goto finish;
+ }
+
+ free(p);
+ } else
+ r = sd_journal_add_match(j, argv[i], strlen(argv[i]));
+