ghetzel / shmtool

A command line utility for interacting with SysV-style shared memory segments, written in Golang. [Linux Only]
GNU Lesser General Public License v2.1
41 stars 16 forks source link

shared memory identifier could be zero #7

Open azmagillian opened 4 years ago

azmagillian commented 4 years ago

Hi, As far as i understand shared memory identifier could be zero so i think this check should change and check for a value of -1 to return "Cannot read shared memory segment: SHMID not set" I could do a pull request if you agree! https://github.com/ghetzel/shmtool/blob/d9c620fd7e7dbc848e16f93a7b57f7ccaa3221c5/shm/shm.go#L117

ghetzel commented 4 years ago

Absolutely! A PR would be fantastic, thank you :)