fix(custom): failed getline after closed pipe
This commit is contained in:
		
							parent
							
								
									1b13f9e38c
								
							
						
					
					
						commit
						0acc50264e
					
				|  | @ -54,8 +54,10 @@ void waybar::modules::Custom::continuousWorker() | ||||||
|     char* buff = nullptr; |     char* buff = nullptr; | ||||||
|     size_t len = 0; |     size_t len = 0; | ||||||
|     if (getline(&buff, &len, fp_) == -1) { |     if (getline(&buff, &len, fp_) == -1) { | ||||||
|  |       if (fp_) { | ||||||
|         pclose(fp_); |         pclose(fp_); | ||||||
|         fp_ = nullptr; |         fp_ = nullptr; | ||||||
|  |       } | ||||||
|       thread_.stop(); |       thread_.stop(); | ||||||
|       output_ = { 1, "" }; |       output_ = { 1, "" }; | ||||||
|       std::cerr << name_ + " just stopped, is it endless?" << std::endl; |       std::cerr << name_ + " just stopped, is it endless?" << std::endl; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue