@@ -249,7 +249,7 @@ static bool smb_build_path(char *dest, size_t dest_size, const char *relative_pa
249249 settings_t * settings = config_get_ptr ();
250250 char temp_path [PATH_MAX_LENGTH ];
251251 const char * p ;
252-
252+
253253 if (!settings )
254254 {
255255 RARCH_ERR ("[SMB] Cannot retrieve settings\n" );
@@ -415,10 +415,8 @@ int64_t retro_vfs_file_write_smb(libretro_vfs_implementation_file *stream,
415415int64_t retro_vfs_file_seek_smb (libretro_vfs_implementation_file * stream ,
416416 int64_t offset , int whence )
417417{
418- uint64_t newpos = 0 ;
419418 struct smb2fh * fh ;
420419 struct smb2_context * ctx ;
421- int64_t ret ;
422420
423421 if (!smb_initialized || !stream || !stream -> smb_ctx )
424422 return -1 ;
@@ -440,15 +438,13 @@ int64_t retro_vfs_file_seek_smb(libretro_vfs_implementation_file *stream,
440438 if (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END )
441439 return -1 ;
442440
443- /* libsmb2 returns status via ret, and the new offset via out param */
444- ret = smb2_lseek (ctx , fh , offset , whence , & newpos );
445- if (ret < 0 )
441+ if (smb2_lseek (ctx , fh , offset , whence , NULL ) == - EINVAL )
446442 {
447443 RARCH_ERR ("[SMB] Seek error: %s\n" , smb2_get_error (ctx ));
448444 return -1 ;
449445 }
450446
451- return ( int64_t ) newpos ;
447+ return 0 ;
452448}
453449
454450/* return the current byte offset in an open file */
@@ -457,7 +453,6 @@ int64_t retro_vfs_file_tell_smb(libretro_vfs_implementation_file *stream)
457453 uint64_t cur = 0 ;
458454 struct smb2fh * fh ;
459455 struct smb2_context * ctx ;
460- int64_t ret ;
461456
462457 if (!smb_initialized || !stream || !stream -> smb_ctx )
463458 return -1 ;
@@ -473,8 +468,7 @@ int64_t retro_vfs_file_tell_smb(libretro_vfs_implementation_file *stream)
473468 if (!ctx )
474469 return -1 ;
475470
476- ret = smb2_lseek (ctx , fh , 0 , SEEK_CUR , & cur );
477- if (ret < 0 )
471+ if (smb2_lseek (ctx , fh , 0 , SEEK_CUR , & cur ) == - EINVAL )
478472 {
479473 RARCH_ERR ("[SMB] Tell error: %s\n" , smb2_get_error (ctx ));
480474 return -1 ;
0 commit comments