File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: c9f6d696420107f82304b992cf623b806995fe18
5
- refs/heads/try: 5de56b3ca1defd9206db8364ecef5f3fd8cc5b38
5
+ refs/heads/try: b5286af703e33bd36744fe4cd5bb24f71dbb524e
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -422,7 +422,9 @@ pub fn setenv<T: BytesContainer>(n: &str, v: T) {
422
422
with_env_lock ( || {
423
423
n. with_c_str ( |nbuf| {
424
424
v. with_c_str ( |vbuf| {
425
- libc:: funcs:: posix01:: unistd:: setenv ( nbuf, vbuf, 1 ) ;
425
+ if libc:: funcs:: posix01:: unistd:: setenv ( nbuf, vbuf, 1 ) != 0 {
426
+ panic ! ( IoError :: last_error( ) ) ;
427
+ }
426
428
} )
427
429
} )
428
430
} )
@@ -438,7 +440,9 @@ pub fn setenv<T: BytesContainer>(n: &str, v: T) {
438
440
439
441
unsafe {
440
442
with_env_lock ( || {
441
- libc:: SetEnvironmentVariableW ( n. as_ptr ( ) , v. as_ptr ( ) ) ;
443
+ if libc:: SetEnvironmentVariableW ( n. as_ptr ( ) , v. as_ptr ( ) ) == 0 {
444
+ panic ! ( IoError :: last_error( ) ) ;
445
+ }
442
446
} )
443
447
}
444
448
}
@@ -453,7 +457,9 @@ pub fn unsetenv(n: &str) {
453
457
unsafe {
454
458
with_env_lock ( || {
455
459
n. with_c_str ( |nbuf| {
456
- libc:: funcs:: posix01:: unistd:: unsetenv ( nbuf) ;
460
+ if libc:: funcs:: posix01:: unistd:: unsetenv ( nbuf) != 0 {
461
+ panic ! ( IoError :: last_error( ) ) ;
462
+ }
457
463
} )
458
464
} )
459
465
}
@@ -465,11 +471,14 @@ pub fn unsetenv(n: &str) {
465
471
n. push ( 0 ) ;
466
472
unsafe {
467
473
with_env_lock ( || {
468
- libc:: SetEnvironmentVariableW ( n. as_ptr ( ) , ptr:: null ( ) ) ;
474
+ if libc:: SetEnvironmentVariableW ( n. as_ptr ( ) , ptr:: null ( ) ) == 0 {
475
+ panic ! ( IoError :: last_error( ) ) ;
476
+ }
469
477
} )
470
478
}
471
479
}
472
- _unsetenv ( n) ;
480
+
481
+ _unsetenv ( n)
473
482
}
474
483
475
484
/// Parses input according to platform conventions for the `PATH`
You can’t perform that action at this time.
0 commit comments