summaryrefslogtreecommitdiff
path: root/common/flatpak-instance-private.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-10-11 11:26:52 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-10-23 07:15:39 +0000
commit6daf195e426d45f62c4d100758904c026f914d81 (patch)
tree3973816342639ccb36be6fae6c1821252ecfa202 /common/flatpak-instance-private.h
parent7b04db62b636b45cc2e422bc4e31b805f2bd3c3c (diff)
downloadflatpak-6daf195e426d45f62c4d100758904c026f914d81.tar.gz
Instance: mitigate races, add new launch api
Avoid the 3-second 'afterlife' of instances by using kill (pid, 0) instead of checking the file lock. We trade pid for lock races, but this seems more reliable. Also add flatpak_installation_launch_full that returns a FlatpakInstance for the launched app, and lets us avoid races around killing the app, by using a child watch. Closes: #2221 Approved by: matthiasclasen
Diffstat (limited to 'common/flatpak-instance-private.h')
-rw-r--r--common/flatpak-instance-private.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/common/flatpak-instance-private.h b/common/flatpak-instance-private.h
new file mode 100644
index 00000000..64ac6485
--- /dev/null
+++ b/common/flatpak-instance-private.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright © 2018 Red Hat, Inc
+ *
+ * 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 library 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 library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Matthias Clasen
+ */
+
+#ifndef __FLATPAK_INSTANCE_PRIVATE_H__
+#define __FLATPAK_INSTANCE_PRIVATE_H__
+
+#include "flatpak-instance.h"
+
+FlatpakInstance *flatpak_instance_new (const char *dir);
+
+#endif /* __FLATPAK_INSTANCE_PRIVATE_H__ */