public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 2/2] open_posix/shm_unlink: sanity checking after calling pathconf
@ 2015-07-09  5:33 Maninder Singh
  2015-08-05 12:59 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Maninder Singh @ 2015-07-09  5:33 UTC (permalink / raw)
  To: ltp-list; +Cc: pankaj.m

sanity checking after calling pathconf added

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Reviewed-by: Yogesh Narayan Gaur <yn.gaur@samsung.com>
---
 .../conformance/interfaces/shm_unlink/10-1.c       |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c
index 768863c..20e5bef 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c
@@ -27,6 +27,11 @@ int main(void)
 	char *shm_name;
 
 	name_max = pathconf("/", _PC_NAME_MAX);
+
+	if (name_max == -1) {
+		perror("An error occurs when calling pathconf()");
+		return PTS_UNRESOLVED;
+	}
 	shm_name = malloc(name_max + 3);
 
 	if (!shm_name) {
-- 
1.7.9.5


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH 2/2] open_posix/shm_unlink: sanity checking after calling pathconf
  2015-07-09  5:33 [LTP] [PATCH 2/2] open_posix/shm_unlink: sanity checking after calling pathconf Maninder Singh
@ 2015-08-05 12:59 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2015-08-05 12:59 UTC (permalink / raw)
  To: Maninder Singh; +Cc: ltp-list, pankaj.m

Hi!
> sanity checking after calling pathconf added
> 
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Reviewed-by: Yogesh Narayan Gaur <yn.gaur@samsung.com>
> ---
>  .../conformance/interfaces/shm_unlink/10-1.c       |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c
> index 768863c..20e5bef 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/10-1.c
> @@ -27,6 +27,11 @@ int main(void)
>  	char *shm_name;
>  
>  	name_max = pathconf("/", _PC_NAME_MAX);
> +
> +	if (name_max == -1) {
> +		perror("An error occurs when calling pathconf()");

I've shortened this error message to "pathconf() failed" here and in
10-2.c and pushed both patches, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-05 12:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09  5:33 [LTP] [PATCH 2/2] open_posix/shm_unlink: sanity checking after calling pathconf Maninder Singh
2015-08-05 12:59 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox