[CRIU] [PATCH 11/15] files: check for file descriptor open callback

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Dec 3 05:29:44 PST 2015


Aritificial files can not have "open" callback, because there is nothing,
which has to open in reality, and there is no file descriptor to return.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 files.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/files.c b/files.c
index 1679b9f..2208cc3 100644
--- a/files.c
+++ b/files.c
@@ -945,6 +945,9 @@ static int open_fd(int pid, struct fdinfo_list_entry *fle)
 	if (d->ops->post_open)
 		want_post_open_stage();
 
+	if (!d->ops->open)
+		return 0;
+
 	if (fle != file_master(d))
 		return 0;
 



More information about the CRIU mailing list