[Cbe-oss-dev] spu-tools: Handle chdir return code

D. Herrendoerfer d.herrendoerfer at herrendoerfer.name
Thu Dec 11 02:10:13 EST 2008


Added, thank you very much !

D. Herrendoerfer

On Tue, 2008-12-09 at 16:58 -0200, Andre Detsch wrote:
> Handle chdir return code to avoid trying to access
> tid, phys-id and stat files in the wrong location.
> 
> Signed-off-by: Andre Detsch <adetsch at br.ibm.com>
> 
> --
> Dirk, can you please apply it to SVN?
> 
> Thanks,
> 
> Index: spu-tools/src/ctx-info.c
> ===================================================================
> --- spu-tools.orig/src/ctx-info.c
> +++ spu-tools/src/ctx-info.c
> @@ -340,7 +340,9 @@ process_ctx_entry(struct dirent *entry, 
>  		sprintf(buf, "%s/%s/%s", SPUFS_PATH, gang_name, entry->d_name);
>  	else
>  		sprintf(buf, "%s/%s", SPUFS_PATH, entry->d_name);
> -	chdir(buf);
> +
> +	if (chdir(buf))
> +		return 0;
>  
>  	fp = fopen("tid", "r");
>  	if (fp) {
> Index: spu-tools/src/ChangeLog
> ===================================================================
> --- spu-tools.orig/src/ChangeLog
> +++ spu-tools/src/ChangeLog
> @@ -1,3 +1,7 @@
> +2008-12-09 Andre Detsch <adetsch at br.ibm.com>
> +	* ctx-info.c: Handle chdir return code, to avoid trying to access
> +	tid, phys-id and stat files in the wrong location.
> +
>  2008-09-02 Andre Detsch <adetsch at br.ibm.com>
>  	* ctx-info.c: Enhanced PID retrieval.
>  
> _______________________________________________
> cbe-oss-dev mailing list
> cbe-oss-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/cbe-oss-dev




More information about the cbe-oss-dev mailing list