Allow passing fd == NULL to exec_file_find and solib_find
authorGary Benson <gbenson@redhat.com>
Wed, 29 Apr 2015 14:20:22 +0000 (15:20 +0100)
committerGary Benson <gbenson@redhat.com>
Wed, 29 Apr 2015 14:20:22 +0000 (15:20 +0100)
commit998d2a3ef31378d3d980972dc68f4926b720a7e9
tree368ec6a68f148273e08b1ebd73641e0182f21666
parenta93d5cb1976818c8d34133fd8798b3df76269f80
Allow passing fd == NULL to exec_file_find and solib_find

This commit allows NULL to be passed as the int *fd argument
to exec_file_find and solib_find to simplify use cases where
the caller does not require the file to be opened.

gdb/ChangeLog:

* solib.c (solib_find_1): Allow fd argument to be NULL.
(exec_file_find): Update comment.
(solib_find): Likewise.
* exec.c (exec_file_locate_attach): Use NULL as fd
argument to exec_file_find to avoid having to close
the opened file.
* infrun.c (follow_exec): Likewise.
gdb/ChangeLog
gdb/exec.c
gdb/infrun.c
gdb/solib.c